camunda-bpmn-js 0.13.0-drilldown.0 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +92 -0
- package/dist/assets/base-navigated-viewer.css +2 -0
- package/dist/assets/base-viewer.css +2 -0
- package/dist/assets/bpmn-js.css +7 -4
- package/dist/assets/camunda-cloud-modeler.css +2 -1
- package/dist/assets/camunda-cloud-navigated-viewer.css +1 -0
- package/dist/assets/camunda-cloud-viewer.css +1 -0
- package/dist/assets/camunda-platform-navigated-viewer.css +1 -0
- package/dist/assets/camunda-platform-viewer.css +1 -0
- package/dist/assets/element-templates.css +4 -0
- package/dist/assets/properties-panel.css +901 -877
- package/dist/base-modeler.development.js +1949 -3883
- package/dist/base-modeler.production.min.js +4 -4
- package/dist/base-navigated-viewer.development.js +22218 -0
- package/dist/base-navigated-viewer.production.min.js +2 -0
- package/dist/base-viewer.development.js +21227 -0
- package/dist/base-viewer.production.min.js +2 -0
- package/dist/camunda-cloud-modeler.development.js +8579 -5480
- package/dist/camunda-cloud-modeler.production.min.js +4 -4
- package/dist/camunda-cloud-navigated-viewer.development.js +23041 -0
- package/dist/camunda-cloud-navigated-viewer.production.min.js +2 -0
- package/dist/camunda-cloud-viewer.development.js +22050 -0
- package/dist/camunda-cloud-viewer.production.min.js +2 -0
- package/dist/camunda-platform-modeler.development.js +6777 -8719
- package/dist/camunda-platform-modeler.production.min.js +4 -4
- package/dist/camunda-platform-navigated-viewer.development.js +23413 -0
- package/dist/camunda-platform-navigated-viewer.production.min.js +2 -0
- package/dist/camunda-platform-viewer.development.js +22422 -0
- package/dist/camunda-platform-viewer.production.min.js +2 -0
- package/lib/base/NavigatedViewer.js +3 -0
- package/lib/base/Viewer.js +3 -0
- package/lib/camunda-cloud/ElementTemplatesValidator.js +1 -0
- package/lib/camunda-cloud/Modeler.js +8 -7
- package/lib/camunda-cloud/NavigatedViewer.js +34 -0
- package/lib/camunda-cloud/Viewer.js +34 -0
- package/lib/camunda-cloud/util/commonModules.js +14 -0
- package/lib/camunda-platform/Modeler.js +5 -5
- package/lib/camunda-platform/NavigatedViewer.js +25 -0
- package/lib/camunda-platform/Viewer.js +24 -0
- package/lib/camunda-platform/util/commonModules.js +7 -0
- package/lib/util/ExtensionElementsUtil.js +59 -0
- package/package.json +33 -15
- package/styles/base-navigated-viewer.css +2 -0
- package/styles/base-viewer.css +2 -0
- package/styles/camunda-cloud-modeler.css +2 -1
- package/styles/camunda-cloud-navigated-viewer.css +1 -0
- package/styles/camunda-cloud-viewer.css +1 -0
- package/styles/camunda-platform-navigated-viewer.css +1 -0
- package/styles/camunda-platform-viewer.css +1 -0
- package/util/index.js +39 -0
- package/dist/assets/bpmn-js-properties-panel.css +0 -778
- package/lib/camunda-cloud/features/modeling/behavior/CleanUpAssignmentDefinitionBehavior.js +0 -78
- package/lib/camunda-cloud/features/modeling/behavior/CleanUpBusinessRuleTaskBehavior.js +0 -112
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeBoundaryEventBehavior.js +0 -76
- package/lib/camunda-cloud/features/modeling/behavior/CreateZeebeCallActivityBehavior.js +0 -74
- package/lib/camunda-cloud/features/modeling/behavior/FormDefinitionBehavior.js +0 -138
- package/lib/camunda-cloud/features/modeling/behavior/UpdatePropagateAllChildVariablesBehavior.js +0 -109
- package/lib/camunda-cloud/features/modeling/behavior/index.js +0 -24
- package/lib/camunda-cloud/features/modeling/index.js +0 -7
- package/lib/camunda-cloud/helper/CalledElementHelper.js +0 -72
- package/lib/camunda-cloud/helper/ElementHelper.js +0 -18
- package/lib/camunda-cloud/helper/ExtensionElementsHelper.js +0 -17
- package/lib/camunda-cloud/helper/FormsHelper.js +0 -84
- package/lib/camunda-cloud/helper/InputOutputHelper.js +0 -138
- package/lib/camunda-cloud/helper/Utils.js +0 -10
- package/lib/camunda-cloud/helper/ZeebeServiceTaskHelper.js +0 -41
- package/lib/camunda-platform/features/modeling/behavior/DeleteErrorEventDefinitionBehavior.js +0 -67
- package/lib/camunda-platform/features/modeling/behavior/DeleteRetryTimeCycleBehavior.js +0 -84
- package/lib/camunda-platform/features/modeling/behavior/UpdateCamundaExclusiveBehavior.js +0 -65
- package/lib/camunda-platform/features/modeling/behavior/UpdateInputOutputBehavior.js +0 -54
- package/lib/camunda-platform/features/modeling/behavior/UpdateResultVariableBehavior.js +0 -51
- package/lib/camunda-platform/features/modeling/behavior/UserTaskFormsBehavior.js +0 -70
- package/lib/camunda-platform/features/modeling/behavior/UserTaskGeneratedFormsBehavior.js +0 -117
- package/lib/camunda-platform/features/modeling/behavior/index.js +0 -26
- package/lib/camunda-platform/features/modeling/index.js +0 -7
- package/lib/camunda-platform/helper/InputOutputHelper.js +0 -29
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).BpmnNavigatedViewer=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){var t={exports:{}};return e(t,t.exports),t.exports}var n=t((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),i=Object.prototype.toString,r=Object.prototype.hasOwnProperty;function a(e){return void 0!==e}function o(e){return"[object Array]"===i.call(e)}function s(e){return"[object Object]"===i.call(e)}function p(e){return"[object Number]"===i.call(e)}function l(e){var t=i.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function c(e){return"[object String]"===i.call(e)}function u(e,t){return r.call(e,t)}function m(e,t){var n;return t=function(e){return l(e)?e:function(t){return t===e}}(t),f(e,(function(e,i){if(t(e,i))return n=e,!1})),n}function h(e,t){var n=[];return f(e,(function(e,i){t(e,i)&&n.push(e)})),n}function f(e,t){var n;if(void 0!==e){var i=o(e)?b:v;for(var r in e)if(u(e,r)&&!1===t(n=e[r],i(r)))return n}}function d(e,t,n){return f(e,(function(e,i){n=t(n,e,i)})),n}function y(e,t){return!!d(e,(function(e,n,i){return e&&t(n,i)}),!0)}function g(e){return function(t){return y(e,(function(e,n){return t[n]===e}))}}function v(e){return e}function b(e){return Number(e)}function x(e,t){return e.bind(t)}function E(){return(E=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 w(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 E.apply(void 0,[e].concat(n))}function _(e,t){var n=this;t=t||1e3,e.on(["render.shape","render.connection"],t,(function(e,t){var i=e.type,r=t.element,a=t.gfx,o=t.attrs;if(n.canRender(r))return"render.shape"===i?n.drawShape(a,r,o):n.drawConnection(a,r,o)})),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 A(e,t){var n=S(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function S(e){return e&&e.businessObject||e}function C(e){return e&&e.di}function R(e,t){return!A(e,"bpmn:CallActivity")&&(A(e,"bpmn:SubProcess")?!(!(t=t||C(e))||!A(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!A(e,"bpmn:Participant")||!!S(e).processRef)}function k(e){var t=e.businessObject,n=function(e){return A(e,"bpmn:FlowElement")||A(e,"bpmn:Participant")||A(e,"bpmn:Lane")||A(e,"bpmn:SequenceFlow")||A(e,"bpmn:MessageFlow")||A(e,"bpmn:DataInput")||A(e,"bpmn:DataOutput")?"name":A(e,"bpmn:TextAnnotation")?"text":A(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 M(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 P(e,t){return M(t,e),e}_.prototype.canRender=function(){},_.prototype.drawShape=function(){},_.prototype.drawConnection=function(){},_.prototype.getShapePath=function(){},_.prototype.getConnectionPath=function(){};var T={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":2,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function D(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=T[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function O(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return T[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);D(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)D(e,i,t[i])}(e,t);return e}function B(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 N=/\s+/,I=Object.prototype.toString;function L(e){return void 0!==e}function F(e){return new j(e)}function j(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function V(e){var t=e.parentNode;return t&&t.removeChild(e),e}j.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~B(t,e)||t.push(e),L(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},j.prototype.remove=function(e){if("[object RegExp]"===I.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=B(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},j.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},j.prototype.toggle=function(e,t){return this.list?(L(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(L(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},j.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(N);return""===e[0]&&e.shift(),e},j.prototype.has=j.prototype.contains=function(e){return this.list?this.list.contains(e):!!~B(this.array(),e)};var z="http://www.w3.org/2000/svg",W='<svg xmlns="'+z+'"';function G(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(z)&&(e=W+e.substring(4)):(e=W+">"+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 $(e,t){var n;return"<"===e.charAt(0)?(n=G(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(z,e),t&&O(n,t),n}var H=$("svg");function K(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function U(e){return e?H.createSVGTransformFromMatrix(e):H.createSVGTransform()}var q=/([&<>]{1})/g,Y=/([\n\r"]{1})/g,X={"&":"&","<":"<",">":">",'"':"'"};function Z(e,t){return e.replace(t,(function(e,t){return X[t]||t}))}function J(e,t){var n,i,r,a,o;switch(e.nodeType){case 3:t.push(Z(e.textContent,q));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,'="',Z(a.value,Y),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(o=e.childNodes).length;n<i;++n)J(o.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",Z(e.nodeValue,q),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function Q(e,t){var n=G(t);if(function(e){for(var t;t=e.firstChild;)V(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++)M(r[a],e)}}function ee(e,t){if(void 0!==t){try{Q(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)J(t,n),t=t.nextSibling;return n.join("")}(e)}function te(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function ne(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(te(e,i))}(n,t)),n.consolidate()}function ie(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function re(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function ae(e,t){var n=$("polyline");return O(n,{points:re(e)}),t&&O(n,t),n}function oe(e,t,n){return function(e,t){return!!m(e,t)}(e.eventDefinitions,(function(i){return i.$type===t&&function(e,t){return y(t,(function(t,n){return e[n]==t}))}(e,n)}))}function se(e){return e.businessObject}function pe(e,t){var n=C(e);return n.get("color:background-color")||n.get("bioc:fill")||t||"white"}function le(e,t){var n=C(e);return n.get("color:border-color")||n.get("bioc:stroke")||t||"black"}function ce(e,t,n){var i=C(e).get("label");return i&&i.get("color:color")||t||le(e,n)}var ue=[].indexOf,me=function(e,t){if(ue)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},he=/\s+/,fe=Object.prototype.toString;function de(e){return new ye(e)}function ye(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function ge(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}ye.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~me(t,e)||t.push(e),this.el.className=t.join(" "),this},ye.prototype.remove=function(e){if("[object RegExp]"==fe.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=me(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},ye.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},ye.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)},ye.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(he);return""===e[0]&&e.shift(),e},ye.prototype.has=ye.prototype.contains=function(e){return this.list?this.list.contains(e):!!~me(this.array(),e)};var ve="undefined"!=typeof Element?Element.prototype:{},be=ve.matches||ve.matchesSelector||ve.webkitMatchesSelector||ve.mozMatchesSelector||ve.msMatchesSelector||ve.oMatchesSelector,xe=function(e,t){if(!e||1!==e.nodeType)return!1;if(be)return be.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 Ee(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(xe(i,t))return i;i=i.parentNode}return xe(i,t)?i:null}var we=window.addEventListener?"addEventListener":"attachEvent",_e=window.removeEventListener?"removeEventListener":"detachEvent",Ae="addEventListener"!==we?"on":"",Se={bind:function(e,t,n,i){return e[we](Ae+t,n,i||!1),n},unbind:function(e,t,n,i){return e[_e](Ae+t,n,i||!1),n}},Ce=["focus","blur"];var Re,ke={bind:function(e,t,n,i,r){return-1!==Ce.indexOf(n)&&(r=!0),Se.bind(e,n,(function(n){var r=n.target||n.srcElement;n.delegateTarget=Ee(r,t,!0),n.delegateTarget&&i.call(e,n)}),r)},unbind:function(e,t,n,i){return-1!==Ce.indexOf(t)&&(i=!0),Se.unbind(e,t,n,i)}},Me=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){return(r=t.createElement("html")).innerHTML=e,r.removeChild(r.lastChild)}var r,a=Te[i]||Te._default,o=a[0],s=a[1],p=a[2];(r=t.createElement("div")).innerHTML=s+e+p;for(;o--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);var l=t.createDocumentFragment();for(;r.firstChild;)l.appendChild(r.removeChild(r.firstChild));return l},Pe=!1;"undefined"!=typeof document&&((Re=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Pe=!Re.getElementsByTagName("link").length,Re=void 0);var Te={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:Pe?[1,"X<div>","</div>"]:[0,"",""]};function De(e,t){return(t=t||document).querySelector(e)}function Oe(e){e.parentNode&&e.parentNode.removeChild(e)}function Be(e,t,n,i,r){var a=U();a.setTranslate(t,n);var o=U();o.setRotate(i||0,0,0);var s=U();s.setScale(r||1,r||1),ne(e,[a,o,s])}function Ne(e,t,n){var i=U();i.setTranslate(t,n),ne(e,i)}Te.td=Te.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Te.option=Te.optgroup=[1,'<select multiple="multiple">',"</select>"],Te.thead=Te.tbody=Te.colgroup=Te.caption=Te.tfoot=[1,"<table>","</table>"],Te.polyline=Te.ellipse=Te.polygon=Te.circle=Te.text=Te.line=Te.path=Te.rect=Te.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Ie=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 p=parseInt(o,n);return p!==1/0&&p>=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 Le(e){if(!(this instanceof Le))return new Le(e);e=e||[128,36,1],this._seed=e.length?Ie.rack(e[0],e[1],e[2]):e}Le.prototype.next=function(e){return this._seed(e||!0)},Le.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},Le.prototype.claim=function(e,t){this._seed.set(e,t||!0)},Le.prototype.assigned=function(e){return this._seed.get(e)||!1},Le.prototype.unclaim=function(e){delete this._seed.hats[e]},Le.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var Fe=new Le,je=.95;function Ve(e,t,n,i,r,a,o){_.call(this,t,o);var p=e&&e.defaultFillColor,l=e&&e.defaultStrokeColor,c=e&&e.defaultLabelColor,u=Fe.next(),m={},h=n.computeStyle;function d(e,t){var n=w({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=$("marker");O(t.element,n),P(o,t.element),O(o,{id:e,viewBox:"0 0 20 20",refX:i.x,refY:i.y,markerWidth:20*a,markerHeight:20*a,orient:"auto"});var s=De("defs",r._svg);s||(s=$("defs"),P(r._svg,s)),P(s,o),m[e]=o}function y(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function g(e,t,n){var i=e+"-"+y(t)+"-"+y(n)+"-"+u;return m[i]||function(e,t,n,i){if("sequenceflow-end"===t){var r=$("path");O(r,{d:"M 1 5 L 11 10 L 1 15 Z"}),d(e,{element:r,ref:{x:11,y:10},scale:.5,attrs:{fill:i,stroke:i}})}if("messageflow-start"===t){var a=$("circle");O(a,{cx:6,cy:6,r:3.5}),d(e,{element:a,attrs:{fill:n,stroke:i},ref:{x:6,y:6}})}if("messageflow-end"===t){var o=$("path");O(o,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),d(e,{element:o,attrs:{fill:n,stroke:i,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===t){var s=$("path");O(s,{d:"M 11 5 L 1 10 L 11 15"}),d(e,{element:s,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===t){var p=$("path");O(p,{d:"M 1 5 L 11 10 L 1 15"}),d(e,{element:p,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===t){var l=$("path");O(l,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),d(e,{element:l,attrs:{fill:n,stroke:i},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){var c=$("path");O(c,{d:"M 6 4 L 10 16"}),d(e,{element:c,attrs:{stroke:i},ref:{x:0,y:10},scale:.5})}}(i,e,t,n),"url(#"+i+")"}function v(e,t,n,i,r){s(i)&&(r=i,i=0),i=i||0,"none"===(r=h(r,{stroke:"black",strokeWidth:2,fill:"white"})).fill&&delete r.fillOpacity;var a=t/2,o=n/2,p=$("circle");return O(p,{cx:a,cy:o,r:Math.round((t+n)/4-i)}),O(p,r),P(e,p),p}function b(e,t,n,i,r,a){s(r)&&(a=r,r=0),r=r||0,a=h(a,{stroke:"black",strokeWidth:2,fill:"white"});var o=$("rect");return O(o,{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i}),O(o,a),P(e,o),o}function x(e,t,n){var i=ae(t,n=h(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return P(e,i),i}function E(e,t,n){n=h(n,["no-fill"],{strokeWidth:2,stroke:"black"});var i=$("path");return O(i,{d:t}),O(i,n),P(e,i),i}function A(e,t,n,i){return E(t,n,w({"data-marker":e},i))}function M(e){return j[e]}function T(e){return function(t,n){return M(e)(t,n)}}function D(e,t){var n=se(e),i=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(n);return n.eventDefinitions&&n.eventDefinitions.length>1?n.parallelMultiple?M("bpmn:ParallelMultipleEventDefinition")(t,e,i):M("bpmn:MultipleEventDefinition")(t,e,i):oe(n,"bpmn:MessageEventDefinition")?M("bpmn:MessageEventDefinition")(t,e,i):oe(n,"bpmn:TimerEventDefinition")?M("bpmn:TimerEventDefinition")(t,e,i):oe(n,"bpmn:ConditionalEventDefinition")?M("bpmn:ConditionalEventDefinition")(t,e):oe(n,"bpmn:SignalEventDefinition")?M("bpmn:SignalEventDefinition")(t,e,i):oe(n,"bpmn:EscalationEventDefinition")?M("bpmn:EscalationEventDefinition")(t,e,i):oe(n,"bpmn:LinkEventDefinition")?M("bpmn:LinkEventDefinition")(t,e,i):oe(n,"bpmn:ErrorEventDefinition")?M("bpmn:ErrorEventDefinition")(t,e,i):oe(n,"bpmn:CancelEventDefinition")?M("bpmn:CancelEventDefinition")(t,e,i):oe(n,"bpmn:CompensateEventDefinition")?M("bpmn:CompensateEventDefinition")(t,e,i):oe(n,"bpmn:TerminateEventDefinition")?M("bpmn:TerminateEventDefinition")(t,e,i):null}function B(e,t,n){n=w({size:{width:100}},n);var i=a.createText(t||"",n);return F(i).add("djs-label"),P(e,i),i}function N(e,t,n){return B(e,se(t).name,{box:t,align:n,padding:5,style:{fill:ce(t,c,l)}})}function I(e,t,n){Be(B(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:ce(n,c,l)}}),0,-(-1*n.height),270)}function L(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 j=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=je),v(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:pe(t,p),stroke:le(t,l)};se(t).isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round",fill:pe(t,p),stroke:le(t,l)});var i=M("bpmn:Event")(e,t,n);return D(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?le(t,l):pe(t,p),stroke:n?pe(t,p):le(t,l)})},"bpmn:TimerEventDefinition":function(e,t){var n=v(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:pe(t,p),stroke:le(t,l)});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:le(t,l)});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:le(t,l)})}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?le(t,l):"none",stroke:le(t,l)})},"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:le(t,l)})},"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?le(t,l):"none",stroke:le(t,l)})},"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?le(t,l):"none",stroke:le(t,l)})},"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?le(t,l):"none",stroke:le(t,l)});return function(e,t){var n=U();n.setRotate(t,0,0),ne(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?le(t,l):"none",stroke:le(t,l)})},"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?le(t,l):"none",stroke:le(t,l)})},"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?le(t,l):"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:le(t,l),stroke:le(t,l)})},"bpmn:EndEvent":function(e,t){var n=M("bpmn:Event")(e,t,{strokeWidth:4,fill:pe(t,p),stroke:le(t,l)});return D(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return v(e,t.width,t.height,8,{strokeWidth:4,fill:le(t,l),stroke:le(t,l)})},"bpmn:IntermediateEvent":function(e,t){var n=M("bpmn:Event")(e,t,{strokeWidth:1,fill:pe(t,p),stroke:le(t,l)});return v(e,t.width,t.height,3,{strokeWidth:1,fill:pe(t,"none"),stroke:le(t,l)}),D(t,e),n},"bpmn:IntermediateCatchEvent":T("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":T("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=je),b(e,t.width,t.height,10,n)},"bpmn:Task":function(e,t){var n={fill:pe(t,p),stroke:le(t,l)},i=M("bpmn:Activity")(e,t,n);return N(e,t,"center-middle"),V(e,t),i},"bpmn:ServiceTask":function(e,t){var n=M("bpmn:Task")(e,t);return E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:pe(t,p),stroke:le(t,l)}),E(e,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:pe(t,p)}),E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:pe(t,p),stroke:le(t,l)}),n},"bpmn:UserTask":function(e,t){var n=M("bpmn:Task")(e,t);return E(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:pe(t,p),stroke:le(t,l)}),E(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:pe(t,p),stroke:le(t,l)}),E(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:le(t,l),stroke:le(t,l)}),n},"bpmn:ManualTask":function(e,t){var n=M("bpmn:Task")(e,t);return E(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:pe(t,p),stroke:le(t,l)}),n},"bpmn:SendTask":function(e,t){var n=M("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:le(t,l),stroke:pe(t,p)}),n},"bpmn:ReceiveTask":function(e,t){var n,r=se(t),a=M("bpmn:Task")(e,t);return r.instantiate?(v(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:pe(t,p),stroke:le(t,l)}),a},"bpmn:ScriptTask":function(e,t){var n=M("bpmn:Task")(e,t);return E(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:le(t,l)}),n},"bpmn:BusinessRuleTask":function(e,t){var n=M("bpmn:Task")(e,t);return O(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:pe(t,"#aaaaaa"),stroke:le(t,l)}),O(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{strokeWidth:1,stroke:le(t,l)}),n},"bpmn:SubProcess":function(e,t,n){n=w({fill:pe(t,p),stroke:le(t,l)},n);var i=M("bpmn:Activity")(e,t,n),r=R(t);return function(e){return e&&!!S(e).triggeredByEvent}(t)&&O(i,{strokeDasharray:"1,2"}),N(e,t,r?"center-top":"center-middle"),r?V(e,t):V(e,t,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(e,t){return M("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,t){var i=M("bpmn:SubProcess")(e,t),r=n.style(["no-fill","no-events"],{stroke:le(t,l)});return b(e,t.width,t.height,8,3,r),i},"bpmn:CallActivity":function(e,t){return M("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:je,fill:pe(t,p),stroke:le(t,l)},i=M("bpmn:Lane")(e,t,n);R(t)?(x(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:le(t,l)}),I(e,se(t).name,t)):B(e,se(t).name,{box:t,align:"center-middle",style:{fill:ce(t,c,l)}});return!!se(t).participantMultiplicity&&M("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=b(e,t.width,t.height,0,w({fill:pe(t,p),fillOpacity:.35,stroke:le(t,l)},n)),r=se(t);"bpmn:Lane"===r.$type&&I(e,r.name,t);return i},"bpmn:InclusiveGateway":function(e,t){var n=M("bpmn:Gateway")(e,t);return v(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:pe(t,p),stroke:le(t,l)}),n},"bpmn:ExclusiveGateway":function(e,t){var n=M("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 C(t).isMarkerVisible&&E(e,r,{strokeWidth:1,fill:le(t,l),stroke:le(t,l)}),n},"bpmn:ComplexGateway":function(e,t){var n=M("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:le(t,l),stroke:le(t,l)}),n},"bpmn:ParallelGateway":function(e,t){var n=M("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:le(t,l),stroke:le(t,l)}),n},"bpmn:EventBasedGateway":function(e,t){var n=se(t),r=M("bpmn:Gateway")(e,t);v(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none",stroke:le(t,l)});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}});O(E(e,s),{strokeWidth:1,fill:"none"})}else if("Exclusive"===a){if(!o)O(v(e,t.width,t.height,.26*t.height),{strokeWidth:1,fill:"none",stroke:le(t,l)});!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:pe(t,"none"),stroke:le(t,l)};E(e,n,r)}()}return r},"bpmn:Gateway":function(e,t){var n={fill:pe(t,p),fillOpacity:je,stroke:le(t,l)};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=h(i,{stroke:"black",strokeWidth:2,fill:"white"});var s=$("polygon");return O(s,{points:o}),O(s,i),P(e,s),s}(e,t.width,t.height,n)},"bpmn:SequenceFlow":function(e,t){var n,i=L(t),r=pe(t,p),a=le(t,l),o=E(e,i,{strokeLinejoin:"round",markerEnd:g("sequenceflow-end",r,a),stroke:le(t,l)}),s=se(t);return t.source&&(n=t.source.businessObject,s.conditionExpression&&n.$instanceOf("bpmn:Activity")&&O(o,{markerStart:g("conditional-flow-marker",r,a)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===s&&O(o,{markerStart:g("conditional-default-flow-marker",r,a)})),o},"bpmn:Association":function(e,t,n){var i=se(t),r=pe(t,p),a=le(t,l);return n=w({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:le(t,l)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=g("association-end",r,a)),"Both"===i.associationDirection&&(n.markerStart=g("association-start",r,a)),x(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=pe(t,p),i=le(t,l);return M("bpmn:Association")(e,t,{markerEnd:g("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=pe(t,p),i=le(t,l);return M("bpmn:Association")(e,t,{markerEnd:g("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var n=se(t),r=C(t),a=pe(t,p),o=le(t,l),s=E(e,L(t),{markerEnd:g("messageflow-end",a,o),markerStart:g("messageflow-start",a,o),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:le(t,l)});if(n.messageRef){var u=s.getPointAtLength(s.getTotalLength()/2),m=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),h={strokeWidth:1};"initiating"===r.messageVisibleKind?(h.fill="white",h.stroke="black"):(h.fill="#888",h.stroke="white");var f=E(e,m,h),d=B(e,n.messageRef.name,{align:"center-top",fitBox:!0,style:{fill:le(t,c)}}),y=f.getBBox(),v=d.getBBox();Be(d,u.x-v.width/2,u.y+y.height/2+10,0)}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:pe(t,p),fillOpacity:je,stroke:le(t,l)});return function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}(se(t))&&function(e,t){var n=(t.height-18)/t.height,r=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:n}});E(e,r,{strokeWidth:2})}(e,t),n},"bpmn:DataObjectReference":T("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=M("bpmn:DataObject")(e,t);return E(e,n,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=M("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:pe(t,p),fillOpacity:je,stroke:le(t,l)})},"bpmn:BoundaryEvent":function(e,t){var n=se(t).cancelActivity,i={strokeWidth:1,fill:pe(t,p),stroke:le(t,l)};n||(i.strokeDasharray="6",i.strokeLinecap="round");var r=w({},i,{fillOpacity:1}),a=w({},i,{fill:"none"}),o=M("bpmn:Event")(e,t,r);return v(e,t.width,t.height,3,a),D(t,e),o},"bpmn:Group":function(e,t){return b(e,t.width,t.height,10,{stroke:le(t,l),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 B(e,k(t),{box:n,fitBox:!0,style:w({},a.getExternalStyle(),{fill:ce(t,c,l)})})}(e,t)},"bpmn:TextAnnotation":function(e,t){var n=b(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:le(t,l)}),B(e,se(t).text||"",{box:t,align:"left-top",padding:5,style:{fill:ce(t,c,l)}}),n},ParticipantMultiplicityMarker:function(e,t){A("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:2,fill:pe(t,p),stroke:le(t,l)})},SubProcessMarker:function(e,t){Ne(b(e,14,14,0,{strokeWidth:1,fill:pe(t,p),stroke:le(t,l)}),t.width/2-7.5,t.height-20),A("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:pe(t,p),stroke:le(t,l)})},ParallelMarker:function(e,t,n){A("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:pe(t,p),stroke:le(t,l)})},SequentialMarker:function(e,t,n){A("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:pe(t,p),stroke:le(t,l)})},CompensationMarker:function(e,t,n){A("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:pe(t,p),stroke:le(t,l)})},LoopMarker:function(e,t,n){A("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:pe(t,p),stroke:le(t,l),strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){A("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:le(t,l),stroke:le(t,l)})}};function V(e,t,n){var i,r=se(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},f(n,(function(n){M(n)(e,t,i)})),r.isForCompensation&&M("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&M("AdhocMarker")(e,t,i);var o=r.loopCharacteristics,s=o&&o.isSequential;o&&(void 0===s&&M("LoopMarker")(e,t,i),!1===s&&M("ParallelMarker")(e,t,i),!0===s&&M("SequentialMarker")(e,t,i))}this._drawPath=E,this._renderer=M}n(Ve,_),Ve.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Ve.prototype.canRender=function(e){return A(e,"bpmn:BaseElement")},Ve.prototype.drawShape=function(e,t){var n=t.type;return this._renderer(n)(e,t)},Ve.prototype.drawConnection=function(e,t){var n=t.type;return this._renderer(n)(e,t)},Ve.prototype.getShapePath=function(e){return A(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,ie([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])):A(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,a=e.height;return ie([["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,10):A(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return ie([["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 ie([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var ze={width:150,height:50};function We(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 Ge(e,t,n){for(var i,r=e.shift(),a=r;;){if((i=We(a,n)).width=a?i.width:0," "===a||""===a||i.width<Math.round(t)||a.length<2)return $e(e,a,r,i);a=He(a,i.width,t)}}function $e(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 He(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(e,t){var n,i=e.split(/(\s|-|\u00AD)/g),r=[],a=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+a<t)){"-"!==n&&""!==n||r.pop();break}r.push(n),a+=n.length}var o=r[r.length-1];return o&&""===o&&(r[r.length-1]="-"),r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function Ke(e){this._config=w({},{size:ze,padding:0,style:{},align:"center-top"},e||{})}Ke.prototype.createText=function(e,t){return this.layoutText(e,t).element},Ke.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},Ke.prototype.layoutText=function(e,t){var n=w({},this._config.size,t.box),i=w({},this._config.style,t.style),r=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),a=function(e){return s(e)?w({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),o=t.fitBox||!1,p=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(i),l=e.split(/\u00AD?\r?\n/),c=[],u=n.width-a.left-a.right,m=$("text");for(O(m,{x:0,y:0}),O(m,i),P(function(){var e=document.getElementById("helper-svg");return e||(O(e=$("svg"),{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(e)),e}(),m);l.length;)c.push(Ge(l,u,m));"middle"===r.vertical&&(a.top=a.bottom=0);var h=d(c,(function(e,t,n){return e+(p||t.height)}),0)+a.top+a.bottom,y=d(c,(function(e,t,n){return t.width>e?t.width:e}),0),g=a.top;"middle"===r.vertical&&(g+=(n.height-h)/2),g-=(p||c[0].height)/4;var v=$("text");return O(v,i),f(c,(function(e){var t;switch(g+=p||e.height,r.horizontal){case"left":t=a.left;break;case"right":t=(o?y:u)-a.right-e.width;break;default:t=Math.max(((o?y:u)-e.width)/2+a.left,0)}var n=$("tspan");O(n,{x:t,y:g}),n.textContent=e.text,P(v,n)})),V(m),{dimensions:{width:y,height:h},element:v}};function Ue(e){var t=w({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=w({},t,{fontSize:n},e&&e.externalStyle||{}),r=new Ke({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(30,Math.round(i.height))}},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}Ue.$inject=["config.textRenderer"];var qe=/\{([^{}]+)\}/g,Ye=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var Xe={__init__:["bpmnRenderer"],bpmnRenderer:["type",Ve],textRenderer:["type",Ue],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var a,o,s={};if(t.position){for(var p=t.containerHeight/r.height*t.yScaleFactor,l=t.containerWidth/r.width*t.xScaleFactor,c=0;c<r.heightElements.length;c++)s["y"+c]=r.heightElements[c]*p;for(var u=0;u<r.widthElements.length;u++)s["x"+u]=r.widthElements[u]*l}return a=r.d,o={mx:n,my:i,e:s},String(a).replace(qe,(function(e,t){return function(e,t,n){var i=n;return t.replace(Ye,(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 Ze={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,(function(e,n){return t[n]||"{"+n+"}"}))}]},Je={width:90,height:20};function Qe(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-=15:o+=15,{x:o,y:s}}function et(e,t){var n,i,r,a=e.label;return a&&a.bounds?(r=a.bounds,i={width:Math.max(Je.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?Qe(e.waypoints):A(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+Je.height/2}:{x:e.x+e.width/2,y:e.y+e.height+Je.height/2}}(t),i=Je),w({x:n.x-i.width/2,y:n.y-i.height/2},i)}function tt(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function nt(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 it(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function rt(e,t,n){return w({id:e.id,type:e.$type,businessObject:e,di:t},n)}function at(e,t,n){var i=e.waypoint;return!i||i.length<2?[nt(t),nt(n)]:i.map((function(e){return{x:e.x,y:e.y}}))}function ot(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:it(n),referenced:it(t),property:i}))}function st(e,t,n,i,r,a){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=a}st.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],st.prototype.add=function(e,t,n){var i,r,a,o,s,p,l,c=this._translate;if(A(t,"bpmndi:BPMNPlane")){var u=A(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(rt(e,t,u)),this._canvas.addRootElement(i)}else if(A(t,"bpmndi:BPMNShape")){var m=!R(e,t),h=function(e){return A(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var f=t.bounds;i=this._elementFactory.createShape(rt(e,t,{collapsed:m,hidden:r,x:Math.round(f.x),y:Math.round(f.y),width:Math.round(f.width),height:Math.round(f.height),isFrame:h})),A(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),A(e,"bpmn:Lane")&&(a=0),A(e,"bpmn:DataStoreReference")&&(o=n,s=nt(f),p=s.x,l=s.y,p>=o.x&&p<=o.x+o.width&&l>=o.y&&l<=o.y+o.height||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,a)}else{if(!A(t,"bpmndi:BPMNEdge"))throw new Error(c("unknown di {di} for element {semantic}",{di:it(t),semantic:it(e)}));var d=this._getSource(e),y=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(rt(e,t,{hidden:r,source:d,target:y,waypoints:at(t,d,y)})),A(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),A(e,"bpmn:SequenceFlow")&&(a=0),this._canvas.addConnection(i,n,a)}return function(e){return A(e,"bpmn:Event")||A(e,"bpmn:Gateway")||A(e,"bpmn:DataStoreReference")||A(e,"bpmn:DataObjectReference")||A(e,"bpmn:DataInput")||A(e,"bpmn:DataOutput")||A(e,"bpmn:SequenceFlow")||A(e,"bpmn:MessageFlow")||A(e,"bpmn:Group")}(e)&&k(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},st.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:it(e)}));var r=this._elementRegistry.get(i.id),a=r&&r.attachers;if(!r)throw ot(n,e,i,"attachedToRef");t.host=r,a||(r.attachers=a=[]),-1===a.indexOf(t)&&a.push(t)},st.prototype.addLabel=function(e,t,n){var i,r,a;return i=et(t,n),(r=k(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),a=this._elementFactory.createLabel(rt(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!k(n),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(a,n.parent)},st.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?ot(a,e,i,t+"Ref"):new Error(a("{semantic}#{side} Ref not specified",{semantic:it(e),side:t}))},st.prototype._getSource=function(e){return this._getEnd(e,"source")},st.prototype._getTarget=function(e){return this._getEnd(e,"target")},st.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var pt={__depends__:[Xe,{__depends__:[Ze],bpmnImporter:["type",st]}]};function lt(e){return e.originalEvent||e.srcEvent}function ct(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 ut(e,t){return(lt(e)||e).button===t}function mt(e){return ut(e,0)}function ht(e){var t=lt(e)||e;return!!mt(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function ft(e){return!0}function dt(e){return mt(e)||function(e){return ut(e,1)}(e)}function yt(e,t,n){var i=this;function r(n,i,r){var a,o;(function(e,t){return!(p[e]||mt)(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"},p={"element.contextmenu":ft,"element.mousedown":dt,"element.mouseup":dt,"element.click":dt,"element.dblclick":dt};function l(e,t,n,i){var o=a[n]=function(e){r(n,e)};i&&(p[n]=i),o.$delegate=ke.bind(e,"svg, .djs-element",t,o)}function c(e,t,n){var i=o(n);i&&ke.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,f(s,(function(e,n){c(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,f(s,(function(e,n){l(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"],500,(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:i})})),e.on("interactionEvents.createHit",500,(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 u=d("djs-hit djs-hit-stroke"),m=d("djs-hit djs-hit-click-stroke"),h={all:d("djs-hit djs-hit-all"),"click-stroke":m,stroke:u};function d(e,t){return t=w({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function y(e,t){var n=h[t];if(!n)throw new Error("invalid hit type <"+t+">");return O(e,n),e}function g(e,t){P(e,t)}this.removeHits=function(e){var t;f((t=".djs-hit",(e||document).querySelectorAll(t)),V)},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=ae(t);return y(n,"stroke"),g(e,n),n},this.createBoxHit=function(e,t,n){n=w({x:0,y:0},n);var i=$("rect");return y(i,t),O(i,n),g(e,i),i},this.updateDefaultHit=function(e,t){var n=De(".djs-hit",t);if(n)return e.waypoints?function(e,t){O(e,{points:re(t)})}(n,e.waypoints):O(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=l,this.unregisterEvent=c}yt.$inject=["eventBus","elementRegistry","styles"];var gt={__init__:["interactionEvents"],interactionEvents:["type",yt]};function vt(e,t){var n,i,r,a;return t=!!t,o(e)||(e=[e]),f(e,(function(e){var o=e;e.waypoints&&!t&&(o=vt(e.waypoints,!0));var s=o.x,p=o.y,l=o.height||0,c=o.width||0;(s<n||void 0===n)&&(n=s),(p<i||void 0===i)&&(i=p),(s+c>r||void 0===r)&&(r=s+c),(p+l>a||void 0===a)&&(a=p+l)})),{x:n,y:i,height:a-i,width:r-n}}function bt(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function xt(e){return!(!e||!e.isFrame)}function Et(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),r=this;function a(e,t){var n=$("rect");return O(n,w({x:10,y:10,width:100,height:100},i)),P(e,n),n}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,i=De(".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=De(".djs-outline",n);i||(i=a(n)),r.updateConnectionOutline(i,t)}))}Et.prototype.updateShapeOutline=function(e,t){O(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Et.prototype.updateConnectionOutline=function(e,t){var n=vt(t);O(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Et.$inject=["eventBus","styles","elementRegistry"];var wt={__init__:["outline"],outline:["type",Et]};function _t(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],(function(e){var t=e.element;n.deselect(t)})),e.on(["diagram.clear","root.set"],(function(e){n.select(null)}))}_t.$inject=["eventBus","canvas"],_t.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})}},_t.prototype.get=function(){return this._selectedElements},_t.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},_t.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();o(e)||(e=e?[e]:[]);var r=this._canvas,a=r.getRootElement();e=e.filter((function(e){var t=r.findRoot(e);return a===t})),t?f(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 At="hover",St="selected";function Ct(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,At)})),e.on("element.out",(function(e){a(e.element,At)})),e.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;f(t,(function(e){-1===n.indexOf(e)&&a(e,St)})),f(n,(function(e){-1===t.indexOf(e)&&r(e,St)}))}))}function Rt(e,t,n,i){e.on("create.end",500,(function(e){var n=e.context,i=n.canExecute,r=n.elements,a=(n.hints||{}).autoSelect;if(i){if(!1===a)return;o(a)?t.select(a):t.select(r.filter(kt))}})),e.on("connect.end",500,(function(e){var n=e.context,i=n.canExecute,r=n.hover;i&&r&&t.select(r)})),e.on("shape.move.end",500,(function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);m(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if(mt(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),a=t.get().length>1,o=ht(e)||function(e){var t=lt(e)||e;return mt(e)&&t.shiftKey}(e);if(r&&a)return o?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,o)}}))}function kt(e){return!e.hidden}Ct.$inject=["eventBus","canvas","selection","styles"],Rt.$inject=["eventBus","selection","canvas","elementRegistry"];var Mt={__init__:["selectionVisuals","selectionBehavior"],__depends__:[gt,wt],selection:["type",_t],selectionVisuals:["type",Ct],selectionBehavior:["type",Rt]};function Pt(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Pt.prototype.next=function(){return this._prefix+ ++this._counter};var Tt=new Pt("ov");function Dt(e,t,n,i){var r,a;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=Tt,this._overlayDefaults=w({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),a=Me('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),r.insertBefore(a,r.firstChild),a),this._init()}function Ot(e,t,n){w(e.style,{left:t+"px",top:n+"px"})}function Bt(e,t){e.style.display=!1===t?"none":""}function Nt(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}Dt.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Dt.prototype.get=function(e){if(c(e)&&(e={id:e}),c(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?h(t.overlays,g({type:e.type})):t.overlays.slice():[]}return e.type?h(this._overlays,g({type:e.type})):e.id?this._overlays[e.id]:null},Dt.prototype.add=function(e,t,n){if(s(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=w({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},Dt.prototype.remove=function(e){var t=this.get(e)||[];o(t)||(t=[t]);var n=this;f(t,(function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Oe(e.html),Oe(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)}}))},Dt.prototype.show=function(){Bt(this._overlayRoot)},Dt.prototype.hide=function(){Bt(this._overlayRoot,!1)},Dt.prototype.clear=function(){this._overlays={},this._overlayContainers=[],ge(this._overlayRoot)},Dt.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var a=vt(t);i=a.x,r=a.y}Ot(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)},Dt.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?vt(a).width:a.width,o=-1*i.right+t);void 0!==i.bottom&&(n=a.waypoints?vt(a).height:a.height,s=-1*i.bottom+n);Ot(r,o||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Dt.prototype._createOverlayContainer=function(e){var t=Me('<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},Dt.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Nt(this._overlayRoot,n)},Dt.prototype._getOverlayContainer=function(e,t){var n=m(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},Dt.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)),c(a)&&(a=Me(a)),n=this._getOverlayContainer(r),(t=Me('<div class="djs-overlay" data-overlay-id="'+i+'" style="position: absolute">')).appendChild(a),e.type&&de(t).add("djs-overlay-"+e.type),Bt(t,this._canvas.findRoot(r)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Dt.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,s=e.htmlContainer,p=!0;(i!==this._canvas.getRootElement()||n&&(a(r)&&r>t.scale||a(o)&&o<t.scale))&&(p=!1),Bt(s,p),this._updateOverlayScale(e,t)},Dt.prototype._updateOverlayScale=function(e,t){var n,i,r,o=e.scale,s=e.htmlContainer,p="";!0!==o&&(!1===o?(n=1,i=1):(n=o.min,i=o.max),a(n)&&t.scale<n&&(r=(1/t.scale||1)*n),a(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),a(r)&&(p="scale("+r+","+r+")"),Nt(s,p)},Dt.prototype._updateOverlaysVisibilty=function(e){var t=this;f(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},Dt.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;f(t.get({element:n}),(function(e){t.remove(e.id)}));var i=t._getOverlayContainer(n);if(i){Oe(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&&(f(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&&de(n.html)[e.add?"add":"remove"](e.marker)})),e.on("root.set",(function(){t._updateOverlaysVisibilty(t._canvas.viewbox())})),e.on("diagram.clear",this.clear,this)};var It={__init__:["overlays"],overlays:["type",Dt]};function Lt(e,t,n,i){e.on("element.changed",(function(i){var r=i.element;(r.parent||r===t.getRootElement())&&(i.gfx=n.getGraphics(r)),i.gfx&&e.fire(bt(r)+".changed",i)})),e.on("elements.changed",(function(t){var n=t.elements;n.forEach((function(t){e.fire("element.changed",{element:t})})),i.updateContainments(n)})),e.on("shape.changed",(function(e){i.update("shape",e.element,e.gfx)})),e.on("connection.changed",(function(e){i.update("connection",e.element,e.gfx)}))}Lt.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var Ft={__init__:["changeSupport"],changeSupport:["type",Lt]};function jt(e){this._eventBus=e}jt.$inject=["eventBus"],jt.prototype.on=function(e,t,n,i,r,a){if((l(t)||p(t))&&(a=r,r=i,i=n,n=t,t=null),l(n)&&(a=r,r=i,i=n,n=1e3),s(r)&&(a=r,r=!1),!l(i))throw new Error("handlerFn must be a function");o(e)||(e=[e]);var c=this._eventBus;f(e,(function(e){var o=["commandStack",e,t].filter((function(e){return e})).join(".");c.on(o,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,a):i,a)}))};function Vt(e,t){t.invoke(jt,this),this.executed((function(t){var n=t.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()})),this.revert((function(t){var n=t.context;n.rootElement&&e.setRootElement(n.rootElement)}))}f(["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"],(function(e){jt.prototype[e]=function(t,n,i,r,a){(l(t)||p(t))&&(a=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,a)}})),n(Vt,jt),Vt.$inject=["canvas","injector"];var zt={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",Vt]};
|
|
2
|
+
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */t((function(t,n){var i;i=e,t.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,n=String(e),i=n.length,r=-1,a="",o=n.charCodeAt(0);++r<i;)0!=(t=n.charCodeAt(r))?a+=t>=1&&t<=31||127==t||0==r&&t>=48&&t<=57||1==r&&t>=48&&t<=57&&45==o?"\\"+t.toString(16)+" ":0==r&&1==i&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?"\\"+n.charAt(r):n.charAt(r):a+="�";return a};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}(i)}));var Wt={"&":"&","<":"<",">":">",'"':""","'":"'"};var Gt="_plane";function $t(e){var t=e.id;return A(e,"bpmn:SubProcess")?function(e){return e+Gt}(t):t}function Ht(e,t,n,i){var r=Me('<ul class="bjs-breadcrumbs"></ul>'),a=i.getContainer(),o=de(a);a.appendChild(r);var s=[];function p(e){e&&(s=function(e){for(var t=S(e),n=[],i=t;i;i=i.$parent)(A(i,"bpmn:SubProcess")||A(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var n=s.map((function(e){var n,r=(n=""+(n=e.name||e.id))&&n.replace(/[&<>"']/g,(function(e){return Wt[e]})),a=Me('<li><span class="bjs-crumb"><a title="'+r+'">'+r+"</a></span></li>"),o=i.findRoot($t(e))||i.findRoot(e.id);if(!o&&A(e,"bpmn:Process")){var s=t.find((function(t){var n=S(t);return n&&n.processRef&&n.processRef===e}));o=i.findRoot(s.id)}return a.addEventListener("click",(function(){i.setRootElement(o)})),a}));r.innerHTML="";var a=n.length>1;o.toggle("bjs-breadcrumbs-shown",a),n.forEach((function(e){r.appendChild(e)}))}e.on("element.changed",(function(e){var t=S(e.element);m(s,(function(e){return e===t}))&&p()})),e.on("root.set",(function(e){p(e.element)}))}function Kt(e,t){var n=null,i=new Ut;e.on("root.set",(function(e){var r=e.element,a=t.viewbox(),o=i.get(r);if(i.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=r,!A(r,"bpmn:Collaboration")||o){o=o||{x:0,y:0,zoom:1};var s=(a.x-o.x)*a.scale,p=(a.y-o.y)*a.scale;0===s&&0===p||t.scroll({dx:s,dy:p}),o.zoom!==a.scale&&t.zoom(o.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function Ut(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}-1!==t&&this._entries.splice(t,1)}}Ht.$inject=["eventBus","elementRegistry","overlays","canvas"],Kt.$inject=["eventBus","canvas"];var qt=180,Yt=160;function Xt(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,(function(e,t){n.handleImport(t.definitions)}))}function Zt(e){return A(e,"bpmndi:BPMNDiagram")?e:Zt(e.$parent)}Xt.prototype.handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach((function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}));var n=[];e.diagrams.forEach((function(e){var i=t.createNewDiagrams(e.plane);Array.prototype.push.apply(n,i)})),n.forEach((function(e){t.movePlaneElementsToOrigin(e.plane)}))}},Xt.prototype.createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach((function(t){var r=t.bpmnElement;if(r){var a=r.$parent;A(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),A(a,"bpmn:SubProcess")&&a!==e.bpmnElement&&i.push({diElement:t,parent:a})}}));var r=[];return n.forEach((function(e){if(!t._processToDiagramMap[e.id]){var n=t.createDiagram(e);t._processToDiagramMap[e.id]=n,r.push(n)}})),i.forEach((function(e){for(var i=e.diElement,r=e.parent;r&&-1===n.indexOf(r);)r=r.$parent;if(r){var a=t._processToDiagramMap[r.id];t.moveToDiPlane(i,a.plane)}})),r},Xt.prototype.movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=function(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach((function(e){if(e.bounds){var n=tt(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}})),function(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}(t)}(e),i=n.x-qt,r=n.y-Yt;t.forEach((function(e){e.waypoint?e.waypoint.forEach((function(e){e.x=e.x-i,e.y=e.y-r})):e.bounds&&(e.bounds.x=e.bounds.x-i,e.bounds.y=e.bounds.y-r)}))},Xt.prototype.moveToDiPlane=function(e,t){var n=Zt(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},Xt.prototype.createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},Xt.$inject=["eventBus","moddle"];var Jt=250;function Qt(e,t,n,i){jt.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",Jt,(function(e){var t=e.shape;r.canDrillDown(t)?r.addOverlay(t):r.removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",Jt,(function(e){var t=e.shape;r.canDrillDown(t)?r.addOverlay(t):r.removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],Jt,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r.canDrillDown(i)&&r.addOverlay(i),r.updateDrilldownOverlay(t),r.updateDrilldownOverlay(n),r.updateDrilldownOverlay(i)}),!0),this.reverted(["shape.create","shape.move","shape.delete"],Jt,(function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;r.canDrillDown(i)&&r.addOverlay(i),r.updateDrilldownOverlay(t),r.updateDrilldownOverlay(n),r.updateDrilldownOverlay(i)}),!0),t.on("import.done",(function(){n.filter((function(e){return r.canDrillDown(e)})).map((function(e){r.addOverlay(e)}))}))}n(Qt,jt),Qt.prototype.updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this.updateOverlayVisibility(n)}},Qt.prototype.canDrillDown=function(e){var t=this._canvas;return A(e,"bpmn:SubProcess")&&t.findRoot($t(e))},Qt.prototype.updateOverlayVisibility=function(e){var t=this._overlays,n=e.businessObject,i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.flowElements&&n.flowElements.length;de(i.html).toggle("bjs-drilldown-empty",!r)}},Qt.prototype.addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this.removeOverlay(e);var i=Me('<button class="bjs-drilldown"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg></button>');i.addEventListener("click",(function(){t.setRootElement(t.findRoot($t(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this.updateOverlayVisibility(e)},Qt.prototype.removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Qt.$inject=["canvas","eventBus","elementRegistry","overlays"];var en={__depends__:[It,Ft,zt],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Ht],drilldownCentering:["type",Kt],drilldownOverlayBehavior:["type",Qt],subprocessCompatibility:["type",Xt]},tn=/^class /;function nn(e){return"[object Array]"===Object.prototype.toString.call(e)}function rn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function an(){var e=Array.prototype.slice.call(arguments);1===e.length&&nn(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var on=/constructor\s*[^(]*\(\s*([^)]*)\)/m,sn=/^(?:async )?(?:function\s*)?[^(]*\(\s*([^)]*)\)/m,pn=/\/\*([^*]*)\*\//m;function ln(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(function(e){return tn.test(e.toString())}(e)?on:sn);return t&&t[1]&&t[1].split(",").map((function(e){return(t=e.match(pn))?t[1].trim():e.trim()}))||[]}function cn(){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)}}function un(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){if(!i[e]&&-1!==e.indexOf(".")){for(var p=e.split("."),l=s(p.shift());p.length;)l=l[p.shift()];return l}if(rn(r,e))return r[e];if(rn(i,e)){if(-1!==n.indexOf(e))throw n.push(e),o("Cannot resolve circular dependency!");return n.push(e),r[e]=i[e][0](i[e][1]),n.pop(),r[e]}return t.get(e,a)},p=function(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!nn(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=an(e.slice())}return{fn:e,dependencies:(e.$inject||ln(e)).map((function(e){return rn(t,e)?t[e]:s(e)}))}},l=function(e){var t=p(e),n=t.fn,i=t.dependencies;return new(Function.prototype.bind.apply(n,[null].concat(i)))},c=function(e,t,n){var i=p(e,n),r=i.fn,a=i.dependencies;return r.apply(t,a)},u=function(e){return an((function(t){return e.get(t)}))},m={factory:c,type:l,value:function(e){return e}};e.forEach((function(e){function t(e,t){return"value"!==e&&nn(t)&&(t=an(t.slice())),t}if(e instanceof cn)e.forEach((function(e){var n=e[0],r=e[1],a=e[2];i[n]=[m[r],t(r,a),r]}));else if("object"==typeof e)if(e.__exports__){var n=Object.keys(e).reduce((function(t,n){return"__"!==n.substring(0,2)&&(t[n]=e[n]),t}),Object.create(null)),r=new un((e.__modules__||[]).concat([n]),a),o=an((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]=[m[r],t(r,a),r]}else i[n]=e[n]}))})),this.get=s,this.invoke=c,this.instantiate=l,this.createChild=function(e,t){if(t&&t.length){var n,r,o,s,p=Object.create(null),l=Object.create(null),c=[],m=[],h=[];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]),m.push(o),h.push(s),p[f]=[s,f,"private",o]):p[f]=[h[r],f,"private",m[r]]:p[f]=[n[2],n[1]],l[f]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach((function(e){-1!==n[1].$scope.indexOf(e)&&(p[f]=[n[2],n[1]],l[e]=!0)}));t.forEach((function(e){if(!l[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(p)}return new un(e,a)}}function mn(e,t){_.call(this,e,1),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})}n(mn,_),mn.prototype.canRender=function(){return!0},mn.prototype.drawShape=function(e,t,n){var i=$("rect");return O(i,{x:0,y:0,width:t.width||0,height:t.height||0}),xt(t)?O(i,w({},this.FRAME_STYLE,n||{})):O(i,w({},this.SHAPE_STYLE,n||{})),P(e,i),i},mn.prototype.drawConnection=function(e,t,n){var i=ae(t.waypoints,w({},this.CONNECTION_STYLE,n||{}));return P(e,i),i},mn.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return ie([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},mn.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 ie(r)},mn.$inject=["eventBus","styles"];var hn={__init__:["defaultRenderer"],defaultRenderer:["type",mn],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 w(this.style(t,n),{class:e})},this.style=function(t,n){o(t)||n||(n=t,t=[]);var i=d(t,(function(t,n){return w(t,e[n]||{})}),{});return n?w(i,n):i},this.computeStyle=function(e,n,i){return o(n)||(i=n,n=[]),t.style(n||[],w({},i,e||{}))}}]};function fn(e,t){return Math.round(e*t)/t}function dn(e){return p(e)?e+"px":e}function yn(e,t,n){var i=$("g");F(i).add(t);var r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}var gn={shape:["x","y","width","height"],connection:["waypoints"]};function vn(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}function bn(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}vn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],vn.prototype._init=function(e){var t=this._eventBus,n=this._container=function(e){var t=(e=w({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),w(n.style,{position:"relative",overflow:"hidden",width:dn(e.width),height:dn(e.height)}),t.appendChild(n),n}(e),i=this._svg=$("svg");O(i,{width:"100%",height:"100%"}),P(n,i);var r=this._viewport=yn(i,"viewport");!1!==e.deferUpdate&&(this._viewboxChanged=function(e,t){var n,i,r,a;function o(n){var o=Date.now(),l=n?0:a+t-o;if(l>0)return s(l);e.apply(r,i),p()}function s(e){n=setTimeout(o,e)}function p(){n&&clearTimeout(n),n=a=i=r=void 0}function l(){a=Date.now();for(var e=arguments.length,o=new Array(e),p=0;p<e;p++)o[p]=arguments[p];i=o,r=this,n||s(t)}return l.flush=function(){n&&o(!0),p()},l.cancel=p,l}(x(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","root.set"],(function(){delete this._cachedViewbox}),this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},vn.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._planes,delete this._rootElement,delete this._viewport},vn.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach((function(t){var n=bt(t);"root"===n?e.removeRootElement(t):e._removeElement(t,n)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},vn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},vn.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},vn.prototype._getChildIndex=function(e){return d(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},vn.prototype._createLayer=function(e,t){void 0===t&&(t=1);var n=this._getChildIndex(t);return{group:yn(this._viewport,"layer-"+e,n),index:t,visible:!0}},vn.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");var n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;var a=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[a]||null),t.visible=!0,i},vn.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");var t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");var n=t.group;return t.visible?(V(n),t.visible=!1,n):n},vn.prototype._removeLayer=function(e){var t=this._layers[e];t&&(delete this._layers[e],V(t.group))},vn.prototype.getActiveLayer=function(){var e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},vn.prototype.findRoot=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),e)return(this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(e))||{}).rootElement},vn.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},vn.prototype._findPlaneForRoot=function(e){return m(this._planes,(function(t){return t.rootElement===e}))},vn.prototype.getContainer=function(){return this._container},vn.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(f([i.gfx,i.secondaryGfx],(function(e){e&&(n?F(e).add(t):F(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},vn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},vn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},vn.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),F(this.getGraphics(e)).has(t)},vn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},vn.prototype.getRootElement=function(){var e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},vn.prototype.addRootElement=function(e){var t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});var n=e.layer="root-"+t;this._ensureValid("root",e);var i=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},vn.prototype.removeRootElement=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter((function(t){return t.rootElement!==e})),this._rootElement===e&&(this._rootElement=null),e},vn.prototype.setRootElement=function(e,t){if(a(t))throw new Error("override not supported");if(e!==this._rootElement){if(!e)throw new Error("rootElement required");return this._findPlaneForRoot(e)||(e=this.addRootElement(e)),this._setRoot(e),e}},vn.prototype._removeRoot=function(e){var t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},vn.prototype._addRoot=function(e,t){var n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},vn.prototype._setRoot=function(e,t){var n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},vn.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 <"+t.id+"> already exists");var n=gn[e];if(!y(n,(function(e){return void 0!==t[e]})))throw new Error("must supply { "+n.join(", ")+" } with "+e)},vn.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},vn.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},vn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},vn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},vn.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},vn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},vn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},vn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},vn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},vn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},vn.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,r,a,o,s,p=this._viewport,l=this.getSize();return e?(this._changeViewbox((function(){a=Math.min(l.width/e.width,l.height/e.height);var t=this._svg.createSVGMatrix().scale(a).translate(-e.x,-e.y);ne(p,t)})),e):(t=(i=this._rootElement?this.getActiveLayer():null)&&i.getBBox()||{},n=(r=ne(p))?r.matrix:function(e,t,n,i,r,a){var o=H.createSVGMatrix();switch(arguments.length){case 0:return o;case 1:return K(o,e);case 6:return K(o,{a:e,b:t,c:n,d:i,e:r,f:a})}}(),a=fn(n.a,1e3),o=fn(-n.e||0,1e3),s=fn(-n.f||0,1e3),e=this._cachedViewbox={x:o?o/a:0,y:s?s/a:0,width:l.width/a,height:l.height/a,scale:a,inner:{width:t.width||0,height:t.height||0,x:t.x||0,y:t.y||0},outer:l})},vn.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox((function(){e=w({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),bn(t,n)})),{x:n.e,y:n.f}},vn.prototype.scrollToElement=function(e,t){var n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));var i=this.findRoot(e);i!==this.getRootElement()&&this.setRootElement(i),t||(t={}),"number"==typeof t&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};var r,a,o=vt(e),s=tt(o),p=this.viewbox(),l=this.zoom();p.y+=t.top/l,p.x+=t.left/l,p.width-=(t.right+t.left)/l,p.height-=(t.bottom+t.top)/l;var c=tt(p);if(o.width<p.width&&o.height<p.height){var u=Math.max(0,s.right-c.right),m=Math.min(0,s.left-c.left),h=Math.max(0,s.bottom-c.bottom),f=Math.min(0,s.top-c.top);r=u||m,a=h||f}else r=o.x-p.x,a=o.y-p.y;this.scroll({dx:-r*l,dy:-a*l})},vn.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)})),fn(i.a,1e3)):this.viewbox(e).scale;var n,i},vn.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},vn.prototype._setZoom=function(e,t){var n,i,r,a,o=this._svg,s=this._viewport,p=o.createSVGMatrix(),l=o.createSVGPoint(),c=(i=s.getCTM()).a;return t?(n=w(l,t).matrixTransform(i.inverse()),r=p.translate(n.x,n.y).scale(1/c*e).translate(-n.x,-n.y),a=i.multiply(r)):a=p.scale(e),bn(this._viewport,a),a},vn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},vn.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}},vn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var xn="data-element-id";function En(e){this._elements={},this._eventBus=e}En.$inject=["eventBus"],En.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),O(t,xn,i),n&&O(n,xn,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},En.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(O(i.gfx,xn,""),i.secondaryGfx&&O(i.secondaryGfx,xn,""),delete t[n])},En.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)},En.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&O(t,xn,i),t},En.prototype.get=function(e){var t;t="string"==typeof e?e:e&&O(e,xn);var n=this._elements[t];return n&&n.element},En.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},En.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],a=r.element;if(e(a,r.gfx))return a}},En.prototype.getAll=function(){return this.filter((function(e){return e}))},En.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)}))},En.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},En.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 wn={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 _n(e,t,n){var i=wn.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 An(e,t){if(!(this instanceof An))return new An(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}An.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?_n(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)},An.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return wn.isExtended(n)||_n(this,t,e),n},An.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},An.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},An.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Sn=An,Cn=wn;Sn.Collection=Cn;var Rn=new Sn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),kn=new Sn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Mn=new Sn({name:"attachers",collection:!0},{name:"host"}),Pn=new Sn({name:"outgoing",collection:!0},{name:"source"}),Tn=new Sn({name:"incoming",collection:!0},{name:"target"});function Dn(){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)}}),Rn.bind(this,"parent"),kn.bind(this,"labels"),Pn.bind(this,"outgoing"),Tn.bind(this,"incoming")}function On(){Dn.call(this),Rn.bind(this,"children"),Mn.bind(this,"host"),Mn.bind(this,"attachers")}function Bn(){On.call(this)}function Nn(){On.call(this),kn.bind(this,"labelTarget")}function In(){Dn.call(this),Pn.bind(this,"source"),Tn.bind(this,"target")}n(On,Dn),n(Bn,On),n(Nn,On),n(In,Dn);var Ln={connection:In,shape:On,label:Nn,root:Bn};function Fn(){this._uid=12}Fn.prototype.createRoot=function(e){return this.create("root",e)},Fn.prototype.createLabel=function(e){return this.create("label",e)},Fn.prototype.createShape=function(e){return this.create("shape",e)},Fn.prototype.createConnection=function(e){return this.create("connection",e)},Fn.prototype.create=function(e,t){return(t=w({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Ln[e];if(!n)throw new Error("unknown type: <"+e+">");return w(new n,t)}(e,t)};var jn=Array.prototype.slice;function Vn(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function zn(){}function Wn(e,t){this._eventBus=e,this._elementRegistry=t}function Gn(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}Vn.prototype.on=function(e,t,n,i){if(e=o(e)?e:[e],l(t)&&(i=n,n=t,t=1e3),!p(t))throw new Error("priority must be a number");var r=n;i&&((r=x(n,i)).__fn=n.__fn||n);var a=this;e.forEach((function(e){a._addListener(e,{priority:t,callback:r,next:null})}))},Vn.prototype.once=function(e,t,n,i){var r=this;if(l(t)&&(i=n,n=t,t=1e3),!p(t))throw new Error("priority must be a number");function a(){a.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,a),t}a.__fn=n,this.on(e,t,a)},Vn.prototype.off=function(e,t){e=o(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},Vn.prototype.createEvent=function(e){var t=new zn;return t.init(e),t},Vn.prototype.fire=function(e,t){var n,i,r,a;if(a=jn.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof zn?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}},Vn.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},Vn.prototype._destroy=function(){this._listeners={}},Vn.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},Vn.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return 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",e),e}return i},Vn.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)},Vn.prototype._getListeners=function(e){return this._listeners[e]},Vn.prototype._setListeners=function(e,t){this._listeners[e]=t},Vn.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)},zn.prototype.stopPropagation=function(){this.cancelBubble=!0},zn.prototype.preventDefault=function(){this.defaultPrevented=!0},zn.prototype.init=function(e){w(this,e||{})},Wn.$inject=["eventBus","elementRegistry"],Wn.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n))||(F(t=$("g")).add("djs-children"),P(n.parentNode,t)):t=n,t},Wn.prototype._clear=function(e){var t=function(e){return e.childNodes[0]}(e);return ge(t),t},Wn.prototype._createContainer=function(e,t,n,i){var r=$("g");F(r).add("djs-group"),void 0!==n?Gn(r,t,t.childNodes[n]):P(t,r);var a=$("g");F(a).add("djs-element"),F(a).add("djs-"+e),i&&F(a).add("djs-frame"),P(r,a);var o=$("g");return F(o).add("djs-visual"),P(a,o),a},Wn.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,xt(t))},Wn.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry;f(d(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._getChildrenContainer(e);f(i.slice().reverse(),(function(e){Gn(n.getGraphics(e).parentNode,r)}))}}))},Wn.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},Wn.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Wn.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},Wn.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Wn.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),Ne(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?O(n,"display","none"):O(n,"display","block")}},Wn.prototype.remove=function(e){V(this._elementRegistry.getGraphics(e).parentNode)};var $n={__depends__:[hn],__init__:["canvas"],canvas:["type",vn],elementRegistry:["type",En],elementFactory:["type",Fn],eventBus:["type",Vn],graphicsFactory:["type",Wn]};function Hn(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 un(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 Kn(e,t){this.injector=t=t||function(e){return Hn([{config:["value",e=e||{}]},$n].concat(e.modules||[]))}(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}function Un(){}function qn(e,t){this.model=e,this.properties=t}Kn.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Kn.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},Un.prototype.get=function(e){return this.$model.properties.get(this,e)},Un.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},qn.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Un.prototype);f(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}),f(e,x((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 Yn={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Xn={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Zn(e,t){var n=Xn[e];return n?n(t):t}function Jn(e){return!!Yn[e]}function Qn(e){return!!Xn[e]}function ei(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 ti(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function ni(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,f(e,x(this.registerPackage,this))}function ii(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function ri(e){this.model=e}function ai(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function oi(e){this.properties=new ri(this),this.factory=new qn(this,this.properties),this.registry=new ni(e,this.properties),this.typeCache={}}ti.prototype.build=function(){return e=this,t=["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"],n={},i=Object(e),f(t,(function(t){t in i&&(n[t]=e[t])})),n;var e,t,n,i},ti.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)},ti.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},ti.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),a=ei(r[0],i),o=ei(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},ti.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},ti.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},ti.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},ti.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},ti.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")},ti.prototype.hasProperty=function(e){return this.propertiesByName[e]},ti.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(f(e.properties,x((function(n){n=w({},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)},ni.prototype.getPackage=function(e){return this.packageMap[e]},ni.prototype.getPackages=function(){return this.packages},ni.prototype.registerPackage=function(e){e=w({},e);var t=this.packageMap;ii(t,e,"prefix"),ii(t,e,"uri"),f(e.types,x((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},ni.prototype.registerType=function(e,t){var n=ei((e=w({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:w(e.meta||{})})).name,t.prefix),i=n.name,r={};f(e.properties,x((function(e){var t=ei(e.name,n.prefix),i=t.name;Jn(e.type)||(e.type=ei(e.type,t.prefix).name),w(e,{ns:t,name:i}),r[i]=e}),this)),w(e,{ns:n,name:i,propertiesByName:r}),f(e.extends,x((function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},ni.prototype.mapTypes=function(e,t,n){var i=Jn(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function a(e){return o(e,!0)}function o(n,i){var a=ei(n,Jn(n)?"":e.prefix);r.mapTypes(a,t,i)}if(!i)throw new Error("unknown type <"+e.name+">");f(i.superClass,n?a:o),t(i,!n),f(i.traits,a)},ni.prototype.getEffectiveDescriptor=function(e){var t=ei(e),n=new ti(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},ni.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},ri.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:ai(e,i,n):e.$attrs[t]=n},ri.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&&ai(e,n,[]),e[i]},ri.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=w({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},ri.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},ri.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},oi.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},oi.prototype.getType=function(e){var t=this.typeCache,n=c(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},oi.prototype.createAny=function(e,t,n){var i=ei(e),r={$type:e,$instanceOf:function(e){return e===this.$type}},a={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,a),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),f(n,(function(e,t){s(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e})),r},oi.prototype.getPackage=function(e){return this.registry.getPackage(e)},oi.prototype.getPackages=function(){return this.registry.getPackages()},oi.prototype.getElementDescriptor=function(e){return e.$descriptor},oi.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},oi.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},oi.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var si=String.fromCharCode,pi=Object.prototype.hasOwnProperty,li=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,ci={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function ui(e,t,n,i){return i?pi.call(ci,i)?ci[i]:"&"+i+";":si(t||parseInt(n,16))}function mi(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(li,ui):e}Object.keys(ci).forEach((function(e){ci[e.toUpperCase()]=ci[e]}));var hi="xsi:type",fi="non-whitespace outside of root node";function di(e){return new Error(e)}function yi(e){return"missing namespace for prefix <"+e+">"}function gi(e){return{get:e,enumerable:!0}}function vi(e){var t,n={};for(t in e)n[t]=e[t];return n}function bi(e){return e+"$uri"}function xi(){return{line:0,column:0}}function Ei(e){throw e}function wi(e){if(!this)return new wi(e);var t,n,i,r,a,o,s,p,l,c=e&&e.proxy,u=Ei,m=xi,h=!1,f=!1,d=null,y=!1;function g(e){e instanceof Error||(e=di(e)),d=e,u(e,m)}function v(e){a&&(e instanceof Error||(e=di(e)),a(e,m))}this.on=function(e,l){if("function"!=typeof l)throw di("required args <name, cb>");switch(e){case"openTag":n=l;break;case"text":t=l;break;case"closeTag":i=l;break;case"error":u=l;break;case"warn":a=l;break;case"cdata":r=l;break;case"attention":p=l;break;case"question":s=l;break;case"comment":o=l;break;default:throw di("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw di("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",f=!0,l=n,this},this.parse=function(e){if("string"!=typeof e)throw di("required args <xml=string>");return d=null,function(e){var a,u,d,b,x,E,w,_,A,S,C,R=f?[]:null,k=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[bi(n)]=t;return i}(l):null,M=[],P=0,T=!1,D=!1,O=0,B=0,N="",I=0;function L(){if(null!==C)return C;var e,t,n,i,r,a,o,s,p,c,u,m=f&&k.xmlns,d=f&&h?[]:null,y=I,g=N,b=g.length,x={},E={};e:for(;y<b;y++)if(p=!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"),p=!0),u=y+1;u<b;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"),p=!0}if("xmlns:xmlns"===(s=g.substring(y,u))&&(v("illegal declaration of xmlns"),p=!0),34===(c=g.charCodeAt(u+1)))-1===(u=g.indexOf('"',y=u+2))&&-1!==(u=g.indexOf("'",y))&&(v("attribute value quote missmatch"),p=!0);else if(39===c)-1===(u=g.indexOf("'",y=u+2))&&-1!==(u=g.indexOf('"',y))&&(v("attribute value quote missmatch"),p=!0);else for(v("missing attribute value quotes"),p=!0,u+=1;u<b&&!(32===(c=g.charCodeAt(u+1))||c<14&&c>8);u++);for(-1===u&&(v("missing closing quotes"),u=b,p=!0),p||(a=g.substring(y,u)),y=u;u+1<b&&!(32===(c=g.charCodeAt(u+1))||c<14&&c>8);u++)y===u&&(v("illegal character after attribute end"),p=!0);if(y=u+1,!p)if(s in E)v("attribute <"+s+"> already defined");else if(E[s]=!0,f)if(h){if(null!==(r="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=mi(a),t=bi(r),!(o=l[e])){if("xmlns"===r||t in k&&k[t]!==e)do{o="ns"+P++}while(void 0!==k[o]);else o=r;l[e]=o}k[r]!==o&&(i||(k=vi(k),i=!0),k[r]=o,"xmlns"===r&&(k[bi(o)]=e,m=o),k[t]=e),x[s]=a;continue}d.push(s,a)}else-1!==(c=s.indexOf(":"))?(n=k[s.substring(0,c)])?((s=m===n?s.substr(c+1):n+s.substr(c))===hi&&(-1!==(c=a.indexOf(":"))?(n=a.substring(0,c),a=(n=k[n]||n)+a.substring(c)):a=m+":"+a),x[s]=a):v(yi(s.substring(0,c))):x[s]=a;else x[s]=a}if(h)for(y=0,b=d.length;y<b;y++){if(s=d[y++],a=d[y],-1!==(c=s.indexOf(":"))){if(!(n=k[s.substring(0,c)])){v(yi(s.substring(0,c)));continue}(s=m===n?s.substr(c+1):n+s.substr(c))===hi&&(-1!==(c=a.indexOf(":"))?(n=a.substring(0,c),a=(n=k[n]||n)+a.substring(c)):a=m+":"+a)}x[s]=a}return C=x}function F(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,a=0,o=0,s=B;O>=o&&(t=i.exec(e))&&!((s=t[0].length+t.index)>O);)r+=1,o=s;return-1==O?(a=s,n=e.substring(B)):0===B?n=e.substring(B,O):(a=O-o,n=-1==B?e.substring(O):e.substring(O,B+1)),{data:n,line:r,column:a}}m=F,c&&(S=Object.create({},{name:gi((function(){return _})),originalName:gi((function(){return A})),attrs:gi(L),ns:gi((function(){return k}))}));for(;-1!==B;){if(-1===(O=60===e.charCodeAt(B)?B:e.indexOf("<",B)))return M.length?g("unexpected end of file"):0===B?g("missing start tag"):void(B<e.length&&e.substring(B).trim()&&v(fi));if(B!==O)if(M.length){if(t&&(t(e.substring(B,O),mi,m),y))return}else if(e.substring(B,O).trim()&&(v(fi),y))return;if(33===(x=e.charCodeAt(O+1))){if(91===(b=e.charCodeAt(O+2))&&"CDATA["===e.substr(O+3,6)){if(-1===(B=e.indexOf("]]>",O)))return g("unclosed cdata");if(r&&(r(e.substring(O+9,B),m),y))return;B+=3;continue}if(45===b&&45===e.charCodeAt(O+3)){if(-1===(B=e.indexOf("--\x3e",O)))return g("unclosed comment");if(o&&(o(e.substring(O+4,B),mi,m),y))return;B+=3;continue}}if(63!==x){for(u=O+1;;u++){if(E=e.charCodeAt(u),isNaN(E))return B=-1,g("unclosed tag");if(34===E)u=-1!==(b=e.indexOf('"',u+1))?b:u;else if(39===E)u=-1!==(b=e.indexOf("'",u+1))?b:u;else if(62===E){B=u;break}}if(33!==x){if(C={},47===x){if(T=!1,D=!0,!M.length)return g("missing open tag");if(u=_=M.pop(),b=O+2+u.length,e.substring(O+2,b)!==u)return g("closing tag mismatch");for(;b<B;b++)if(!(32===(x=e.charCodeAt(b))||x>8&&x<14))return g("close tag")}else{if(47===e.charCodeAt(B-1)?(u=_=e.substring(O+1,B-1),T=!0,D=!0):(u=_=e.substring(O+1,B),T=!0,D=!1),!(x>96&&x<123||x>64&&x<91||95===x||58===x))return g("illegal first char nodeName");for(b=1,d=u.length;b<d;b++)if(!((x=u.charCodeAt(b))>96&&x<123||x>64&&x<91||x>47&&x<59||45===x||95===x||46==x)){if(32===x||x<14&&x>8){_=u.substring(0,b),C=null;break}return g("invalid nodeName")}D||M.push(_)}if(f){if(a=k,T&&(D||R.push(a),null===C&&(h=-1!==u.indexOf("xmlns",b))&&(I=b,N=u,L(),h=!1)),A=_,-1!==(x=_.indexOf(":"))){if(!(w=k[_.substring(0,x)]))return g("missing namespace on <"+A+">");_=_.substr(x+1)}else w=k.xmlns;w&&(_=w+":"+_)}if(T&&(I=b,N=u,n&&(c?n(S,mi,D,m):n(_,L,mi,D,m),y)))return;if(D){if(i&&(i(c?S:_,mi,T,m),y))return;f&&(k=T?a:R.pop())}B+=1}else{if(p&&(p(e.substring(O,B+1),mi,m),y))return;B+=1}}else{if(-1===(B=e.indexOf("?>",O)))return g("unclosed question");if(s&&(s(e.substring(O,B+2),m),y))return;B+=2}}}(e),m=xi,y=!1,d},this.stop=function(){y=!0}}function _i(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var Ai={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Si="xsi:type";function Ci(e){return e.xml&&e.xml.serialize}function Ri(e){return Ci(e)===Si}function ki(e,t){return _i(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Mi(e){return new Error(e)}function Pi(e){return e.$descriptor}function Ti(e){w(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Mi("expected element");var t,n=this.elementsById,i=Pi(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 Mi("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Di(){}function Oi(){}function Bi(){}function Ni(e,t){this.property=e,this.context=t}function Ii(e,t){this.element=t,this.propertyDesc=e}function Li(){}function Fi(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function ji(e,t,n){Fi.call(this,e,t,n)}function Vi(e,t,n){this.model=e,this.context=n}function zi(e){e instanceof oi&&(e={model:e}),w(this,{lax:!1},e)}Di.prototype.handleEnd=function(){},Di.prototype.handleText=function(){},Di.prototype.handleNode=function(){},Oi.prototype=Object.create(Di.prototype),Oi.prototype.handleNode=function(){return this},Bi.prototype=Object.create(Di.prototype),Bi.prototype.handleText=function(e){this.body=(this.body||"")+e},Ni.prototype=Object.create(Bi.prototype),Ni.prototype.handleNode=function(e){if(this.element)throw Mi("expected no sub nodes");return this.element=this.createReference(e),this},Ni.prototype.handleEnd=function(){this.element.id=this.body},Ni.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Ii.prototype=Object.create(Bi.prototype),Ii.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Zn(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Li.prototype=Object.create(Bi.prototype),Li.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},Fi.prototype=Object.create(Li.prototype),Fi.prototype.addReference=function(e){this.context.addReference(e)},Fi.prototype.handleText=function(e){if(!Pi(this.element).bodyProperty)throw Mi("unexpected body text <"+e+">");Bi.prototype.handleText.call(this,e)},Fi.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Pi(t).bodyProperty;n&&void 0!==e&&(e=Zn(n.type,e),t.set(n.name,e))},Fi.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=Pi(i),a=this.context,o=new i({}),s=this.model;return f(n,(function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?f(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=Zn(i.type,e):"xmlns"!==n&&(t=ei(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},Fi.prototype.getPropertyForNode=function(e){var t,n,i=ei(e.name),r=this.type,a=this.model,o=Pi(r),s=i.name,p=o.propertiesByName[s];if(p&&!p.isAttr)return Ri(p)&&(t=e.attributes[Si])?(t=function(e,t){var n=ei(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),w({},p,{effectiveType:Pi(n=a.getType(t)).name})):p;var l=a.getPackage(i.prefix);if(l){if(t=ki(i,l),n=a.getType(t),p=m(o.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return w({},p,{effectiveType:Pi(n).name})}else if(p=m(o.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return p;throw Mi("unrecognized element <"+i.name+">")},Fi.prototype.toString=function(){return"ElementDescriptor["+Pi(this.type).name+"]"},Fi.prototype.valueHandler=function(e,t){return new Ii(e,t)},Fi.prototype.referenceHandler=function(e){return new Ni(e,this.context)},Fi.prototype.handler=function(e){return"Element"===e?new Vi(this.model,e,this.context):new Fi(this.model,e,this.context)},Fi.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Qn(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?(w(a,{element:i}),this.context.addReference(a)):a.$parent=i),r},ji.prototype=Object.create(Fi.prototype),ji.prototype.createElement=function(e){var t=e.name,n=ei(t),i=this.model,r=this.type,a=i.getPackage(n.prefix),o=a&&ki(n,a)||t;if(!r.hasType(o))throw Mi("unexpected element <"+e.originalName+">");return Fi.prototype.createElement.call(this,e)},Vi.prototype=Object.create(Li.prototype),Vi.prototype.createElement=function(e){var t=e.name,n=ei(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Vi.prototype.handleChild=function(e){var t=new Vi(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},Vi.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},zi.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof Fi?(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 Ti(w({},t,{rootHandler:i})),s=new wi({proxy:!0}),p=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function l(e,t,n){var i=t(),r=i.line,a=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var p="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+a+"\n\tnested error: "+e.message;if(n)return o.addWarning({message:p,error:e}),!0;throw Mi(p)}function c(e,t){return l(e,t,!0)}i.context=o,p.push(i);var u=/^<\?xml /i,m=/ encoding="([^"]+)"/i,h=/^utf-8$/i;function f(e,t){try{p.peek().handleText(e)}catch(e){c(e,t)}}var d=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return 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=p.peek();try{p.push(n.handleNode(e))}catch(e){l(e,t,a)&&p.push(new Oi)}}({name:e.name,originalName:e.originalName,attributes:o,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=m.exec(e),n=t&&t[1];n&&!h.test(n)&&o.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){p.pop().handleEnd()})).on("cdata",f).on("text",(function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)})).on("error",l).on("warn",c),new Promise((function(t,n){var r;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=Pi(r).propertiesByName[t.property];if(a||o.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var p=r.get(s.name),l=p.indexOf(t);-1===l&&(l=p.length),a?p[l]=a:p.splice(l,1)}else r.set(s.name,a)}}()}catch(e){r=e}var a=i.element;r||a||(r=Mi("failed to parse document as <"+i.type.$descriptor.name+">"));var p=o.warnings,l=o.references,c=o.elementsById;return r?(r.warnings=p,n(r)):t({rootElement:a,elementsById:c,references:l,warnings:p})}))},zi.prototype.handler=function(e){return new ji(this.model,e)};var Wi=/<|>|'|"|&|\n\r|\n/g,Gi=/<|>|&/g;function $i(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.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},this.logUsed=function(t){var n=t.uri,r=this.getNSKey(t);i[r]=this.byUri(n),e&&e.logUsed(t)},this.getUsed=function(e){var t=this;return[].concat(r,a).filter((function(e){var n=t.getNSKey(e);return i[n]}))}}function Hi(e,t){return _i(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function Ki(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Ui(e){return c(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var qi={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Yi={"<":"lt",">":"gt","&":"amp"};function Xi(e,t,n){return(e=c(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function Zi(e){this.tagName=e}function Ji(){}function Qi(e){this.tagName=e}function er(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function tr(e,t){er.call(this,e,t)}function nr(){this.value="",this.write=function(e){this.value+=e}}function ir(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 rr(e){return e=w({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new nr,r=new ir(i,e.format);if(e.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n'),(new er).build(t).serializeTo(r),!n)return i.value}}}function ar(e,t){oi.call(this,e,t)}Zi.prototype.build=function(e){return this.element=e,this},Zi.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Ji.prototype.serializeValue=Ji.prototype.serializeTo=function(e){e.append(this.escape?Xi(this.value,Gi,Yi):this.value)},Ji.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Gi)&&(this.escape=!0),this},Ki(Qi,Ji),Qi.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},er.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 h(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!u(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)}))}(e),this.parseAttributes(h(n,(function(e){return e.isAttr}))),this.parseContainments(function(e){return h(e,(function(e){return!e.isAttr}))}(n))),this.parseGenericAttributes(e,t),this},er.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?w({localName:t.ns.localName},e):w({localName:Hi(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},er.prototype.nsPropertyTagName=function(e){return function(e,t){return w({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},er.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},er.prototype.nsAttributeName=function(e){var t;if(t=c(e)?ei(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}:w({localName:t.localName},n)},er.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return f(e,(function(r,a){"$body"===a?n.push((new Ji).build({type:"String"},r)):"$children"===a?f(r,(function(e){n.push(new er(t).build(e))})):0!==a.indexOf("$")&&t.parseNsAttribute(e,a,r)&&i.push({name:a,value:r})})),i},er.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,a=ei(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)}},er.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return f(i,(function(t,i){var a=n.parseNsAttribute(e,i,t);a&&r.push(a)})),r},er.prototype.parseGenericAttributes=function(e,t){var n=this;f(t,(function(t){if(t.name!==Si)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}}))},er.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;f(e,(function(e){var r=i.get(e.name),a=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new Ji).build(e,r[0]));else if(Qn(e.type))f(r,(function(i){n.push(new Qi(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(a)f(r,(function(i){n.push(new Zi(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var o=Ri(e),s=function(e){return"property"===Ci(e)}(e);f(r,(function(i){var r;r=o?new tr(t,e):s?new er(t,e):new er(t),n.push(r.build(i))}))}}))},er.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new $i(t):n=t),n},er.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,a=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(a,r),e},er.prototype.logNamespaceUsed=function(e,t){var n,i,r,a=this.element.$model,o=this.getNamespaces(t),s=e.prefix,p=e.uri;if(!s&&!p)return{localName:e.localName};if(r=Ai[s]||a&&(a.getPackage(s)||{}).uri,!(p=p||r||o.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=o.byUri(p))){for(n=s,i=1;o.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:p},r===p)}return s&&o.mapPrefix(s,p),e},er.prototype.parseAttributes=function(e){var t=this,n=this.element;f(e,(function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];f(i,(function(e){r.push(e.id)})),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)}))},er.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Ui(e)},er.prototype.addAttribute=function(e,t){var n=this.attrs;c(t)&&(t=Xi(t,Wi,qi)),n.push({name:e,value:t})},er.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return e.getUsed().filter((function(e){return"xml"!==e.prefix})).map((function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}}))}(n).concat(t)),f(t,(function(t){e.append(" ").append(Ui(t.name)).append('="').append(t.value).append('"')}))},er.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Ji;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),f(this.body,(function(t){t.serializeTo(e)})),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},Ki(tr,er),tr.prototype.parseNsAttributes=function(e){var t=er.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(Si),(i.prefix?i.prefix+":":"")+a+n.ns.localName),t},tr.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},ar.prototype=Object.create(oi.prototype),ar.prototype.fromXML=function(e,t,n){c(t)||(n=t,t="bpmn:Definitions");var i=new zi(w({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},ar.prototype.toXML=function(e,t){var n=new rr(t);return new Promise((function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}}))};var or={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function sr(e,t){return new ar(w({},or,e),t)}function pr(e){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var t=arguments.length;if(!(t>=1&&l(arguments[t-1])))return e.apply(this,arguments);var n=arguments[t-1];console.warn(new Error("Passing callbacks to "+e.name+" is deprecated and will be removed in a future major release. Please switch to promises: https://bpmn.io/l/moving-to-promises.html"));var i=Array.prototype.slice.call(arguments,0,-1);e.apply(this,i).then((function(e){var t=Object.keys(e)[0];return n(null,e[t])}),(function(e){return n(e,e.warnings)}))}}function lr(e,t){return e.$instanceOf(t)}function cr(e,t){var n={},i=[],r={};function a(e,t){return function(n){e(n,t)}}function o(e){n[e.id]=e}function s(n,i){try{var a=r[n.id]&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:it(n)}));return e.element(n,r[n.id],i)}(n,i);return o(n),a}catch(e){p(e.message,{element:n,error:e}),console.error(t("failed to import {element}",{element:it(n)})),console.error(e)}}function p(t,n){e.error(t,n)}function l(e){var n,i=e.bpmnElement;i?r[i.id]?p(t("multiple DI elements defined for {element}",{element:it(i)}),{element:i}):(r[i.id]=e,u(n=i,"di")||Object.defineProperty(n,"di",{get:function(){throw new Error("Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472")}})):p(t("no bpmnElement referenced in {element}",{element:it(e)}),{element:e})}function c(e){var t;l(t=e.plane),f(t.planeElement,d)}function d(e){l(e)}function y(){for(;i.length;)i.shift()()}function g(e,t){P(e,t),A(e.ioSpecification,t),_(e.artifacts,t),o(e)}function v(e,t){s(e,t)}function b(e,t){s(e,t)}function x(e,t){s(e,t)}function E(e,t){s(e,t)}function w(e,t){s(e,t)}function _(e,t){f(e,(function(e){lr(e,"bpmn:Association")?i.push((function(){w(e,t)})):w(e,t)}))}function A(e,t){e&&(f(e.dataInputs,a(x,t)),f(e.dataOutputs,a(E,t)))}function S(e,t){P(e,t),_(e.artifacts,t)}function C(e,t){var n=s(e,t);lr(e,"bpmn:SubProcess")&&S(e,n||t),lr(e,"bpmn:Activity")&&A(e.ioSpecification,t),i.push((function(){f(e.dataInputAssociations,a(b,t)),f(e.dataOutputAssociations,a(b,t))}))}function R(e,t){s(e,t)}function k(e,t){i.push((function(){var n=s(e,t);e.childLaneSet&&M(e.childLaneSet,n||t),function(e){f(e.flowNodeRef,(function(t){var n=t.get("lanes");n&&n.push(e)}))}(e)}))}function M(e,t){f(e.lanes,a(k,t))}function P(e,n){!function(e,n){f(e,(function(e){lr(e,"bpmn:SequenceFlow")?i.push((function(){!function(e,t){s(e,t)}(e,n)})):lr(e,"bpmn:BoundaryEvent")?i.unshift((function(){C(e,n)})):lr(e,"bpmn:FlowNode")?C(e,n):lr(e,"bpmn:DataObject")||(lr(e,"bpmn:DataStoreReference")||lr(e,"bpmn:DataObjectReference")?R(e,n):p(t("unrecognized flowElement {element} in context {context}",{element:it(e),context:n?it(n.businessObject):"null"}),{element:e,context:n}))}))}(e.flowElements,n),e.laneSets&&function(e,t){f(e,a(M,t))}(e.laneSets,n)}function T(e,t){var n=s(e,t),i=e.processRef;i&&g(i,n||t)}return{handleDeferred:y,handleDefinitions:function(o,s){var u=o.diagrams;if(s&&-1===u.indexOf(s))throw new Error(t("diagram not part of bpmn:Definitions"));if(!s&&u&&u.length&&(s=u[0]),!s)throw new Error(t("no diagram to display"));r={},c(s);var d=s.plane;if(!d)throw new Error(t("no plane for {element}",{element:it(s)}));var b=d.bpmnElement;if(!b){if(!(b=function(e){return m(e.rootElements,(function(e){return lr(e,"bpmn:Process")||lr(e,"bpmn:Collaboration")}))}(o)))throw new Error(t("no process or collaboration to display"));p(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:it(d),rootElement:it(b)})),d.bpmnElement=b,l(d)}var x,E,w=function(t,n){return e.root(t,r[t.id],n)}(b,d);if(lr(b,"bpmn:Process")||lr(b,"bpmn:SubProcess"))g(b,w);else{if(!lr(b,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:it(d),rootElement:it(b)}));E=w,f((x=b).participants,a(T,E)),_(x.artifacts,E),i.push((function(){!function(e,t){f(e,a(v,t))}(x.messageFlows,E)})),function(e,t){h(e,(function(e){return!n[e.id]&&lr(e,"bpmn:Process")&&e.laneSets})).forEach(a(g,t))}(o.rootElements,w)}y()},handleSubProcess:S,registerDi:l}}function ur(e,t,n){var i,r,a,o,s=[];function p(e,t){var n=new cr({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}},a);t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t)return;var n,i=t.plane.bpmnElement,r=i;A(i,"bpmn:Process")||A(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(A(t,"bpmn:Process"))return t;t=t.$parent}}(i));n=A(r,"bpmn:Collaboration")?r:m(e.rootElements,(function(e){if(A(e,"bpmn:Collaboration"))return m(e.participants,(function(e){return e.processRef===r}))}));var a=[r];n&&(a=function(e,t){var n=[];return f(e,(function(e,i){n.push(t(e,i))})),n}(n.participants,(function(e){return e.processRef}))).push(n);var o=mr(a),s=[t],p=[i];return f(e.diagrams,(function(e){var t=e.plane.bpmnElement;-1!==o.indexOf(t)&&-1===p.indexOf(t)&&(s.push(e),p.push(t))})),s}(e,t);if(!r)throw new Error(a("no diagram to display"));f(r,(function(t){n.handleDefinitions(e,t)}));var p=t.plane.bpmnElement.id;o.setRootElement(o.findRoot(p+"_plane")||o.findRoot(p))}return new Promise((function(l,c){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),a=e.get("translate"),o=e.get("canvas"),r.fire("import.render.start",{definitions:t}),p(t,n),r.fire("import.render.complete",{error:undefined,warnings:s}),l({warnings:s})}catch(e){return e.warnings=s,c(e)}}))}function mr(e){var t=[];return f(e,(function(e){e&&(t.push(e),t=t.concat(mr(e.flowElements)))})),t}var hr='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21" style="vertical-align:middle"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>';function fr(e){return e.join(";")}var dr,yr=fr(["color: #404040"]),gr='<div class="bjs-powered-by-lightbox" style="'+fr(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+fr(["width: 100%","height: 100%","background: rgba(40,40,40,0.2)"])+'"></div><div class="notice" style="'+fr(["position: absolute","left: 50%","top: 40%","transform: translate(-50%)","width: 260px","padding: 10px","background: white","box-shadow: 0 1px 4px rgba(0,0,0,0.3)","font-family: Helvetica, Arial, sans-serif","font-size: 14px","display: flex","line-height: 1.3"])+'"><a href="https://bpmn.io" target="_blank" rel="noopener" style="margin: 15px 20px 15px 10px; align-self: center;'+yr+'">'+hr+'</a><span>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>';function vr(e){var t,n;e=w({},xr,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,n=Me('<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; '+yr+'">'+hr+"</a>"),t.appendChild(n),Se.bind(n,"click",(function(e){dr||(dr=Me(gr),ke.bind(dr,".backdrop","click",(function(e){document.body.removeChild(dr)}))),document.body.appendChild(dr),e.preventDefault()})),this._init(this._container,this._moddle,e)}function br(e,t){return e.warnings=t,e}n(vr,Kn),vr.prototype.importXML=pr((function(e,t){var n=this;return new Promise((function(i,r){e=n._emit("import.parse.start",{xml:e})||e,n._moddle.fromXML(e,"bpmn:Definitions").then((function(e){var a,o,s=e.rootElement,p=e.references,l=e.warnings,c=e.elementsById;s=n._emit("import.parse.complete",(a={error:null,definitions:s,elementsById:c,references:p,warnings:l},o=n.get("eventBus").createEvent(a),Object.defineProperty(o,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete <context> is deprecated and will be removed in future library versions")),{warnings:a.warnings,references:a.references,elementsById:a.elementsById}}}),o))||s,n.importDefinitions(s,t).then((function(e){var t=[].concat(l,e.warnings||[]);return n._emit("import.done",{error:null,warnings:t}),i({warnings:t})})).catch((function(e){var t=[].concat(l,e.warnings||[]);return n._emit("import.done",{error:e,warnings:t}),r(br(e,t))}))})).catch((function(e){return n._emit("import.parse.complete",{error:e}),e=function(e){var t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]);return e}(e),n._emit("import.done",{error:e,warnings:e.warnings}),r(e)}))}))})),vr.prototype.importDefinitions=pr((function(e,t){var n=this;return new Promise((function(i,r){n._setDefinitions(e),n.open(t).then((function(e){var t=e.warnings;return i({warnings:t})})).catch((function(e){return r(e)}))}))})),vr.prototype.open=pr((function(e){var t=this._definitions,n=e,i=this;return new Promise((function(r,a){if(!t){var o=new Error("no XML imported");return a(br(o,[]))}if("string"==typeof e&&!(n=function(e,t){if(!t)return null;return m(e.diagrams,(function(e){return e.id===t}))||null}(t,e))){var s=new Error("BPMNDiagram <"+e+"> not found");return a(br(s,[]))}try{i.clear()}catch(e){return a(br(e,[]))}ur(i,t,n).then((function(e){var t=e.warnings;return r({warnings:t})})).catch((function(e){return a(e)}))}))})),vr.prototype.saveXML=pr((function(e){e=e||{};var t=this,n=this._definitions;return new Promise((function(i){if(!n)return i({error:new Error("no definitions loaded")});n=t._emit("saveXML.start",{definitions:n})||n,t._moddle.toXML(n,e).then((function(e){var n=e.xml;return n=t._emit("saveXML.serialized",{xml:n})||n,i({xml:n})}))})).catch((function(e){return{error:e}})).then((function(e){t._emit("saveXML.done",e);var n=e.error;return n?Promise.reject(n):e}))})),vr.prototype.saveSVG=pr((function(e){var t=this;return new Promise((function(e,n){var i,r;t._emit("saveSVG.start");try{var a=t.get("canvas"),o=a.getActiveLayer(),s=De("defs",a._svg),p=ee(o),l=s?"<defs>"+ee(s)+"</defs>":"",c=o.getBBox();i='<?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="'+c.width+'" height="'+c.height+'" viewBox="'+c.x+" "+c.y+" "+c.width+" "+c.height+'" version="1.1">'+l+p+"</svg>"}catch(e){r=e}return t._emit("saveSVG.done",{error:r,svg:i}),r?n(r):e({svg:i})}))})),vr.prototype._setDefinitions=function(e){this._definitions=e},vr.prototype.getModules=function(){return this._modules},vr.prototype.clear=function(){this.getDefinitions()&&Kn.prototype.clear.call(this)},vr.prototype.destroy=function(){Kn.prototype.destroy.call(this),Oe(this._container)},vr.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},vr.prototype.off=function(e,t){this.get("eventBus").off(e,t)},vr.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=De(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},vr.prototype.getDefinitions=function(){return this._definitions},vr.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},vr.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),p=w((i=["additionalModules"],r={},f(Object(n),(function(e,t){-1===i.indexOf(t)&&(r[t]=e)})),r),{canvas:w({},n.canvas,{container:e}),modules:s});Kn.call(this,p),n&&n.container&&this.attachTo(n.container)},vr.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},vr.prototype._createContainer=function(e){var t=Me('<div class="bjs-container"></div>');return w(t.style,{width:Er(e.width),height:Er(e.height),position:e.position}),t},vr.prototype._createModdle=function(e){return new sr(w({},this._moddleExtensions,e.moddleExtensions))},vr.prototype._modules=[];var xr={width:"100%",height:"100%",position:"relative"};function Er(e){return e+(p(e)?"px":"")}function wr(e){vr.call(this,e)}function _r(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Ar(e,t){return-1!==(e=o(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.keyCode)}function Sr(e){return e.shiftKey}n(wr,vr),wr.prototype._modules=[pt,Ze,Mt,It,en],wr.prototype._moddleExtensions={};var Cr="keyboard.keydown",Rr="input-handle-modified-keys";function kr(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()}))}kr.$inject=["config.keyboard","eventBus"],kr.prototype._keydownHandler=function(e){this._keyHandler(e,Cr)},kr.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},kr.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Cr,n)&&e.preventDefault()}},kr.prototype._isEventIgnored=function(e){return(t=e.target)&&(xe(t,"input, textarea")||"true"===t.contentEditable)&&this._isModifiedKeyIgnored(e);var t},kr.prototype._isModifiedKeyIgnored=function(e){return!_r(e)||-1===this._getAllowedModifiers(e.target).indexOf(e.key)},kr.prototype._getAllowedModifiers=function(e){var t=Ee(e,"[input-handle-modified-keys]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(Rr).split(",")},kr.prototype.bind=function(e){this.unbind(),this._node=e,Se.bind(e,"keydown",this._keydownHandler,!0),Se.bind(e,"keyup",this._keyupHandler,!0),this._fire("bind")},kr.prototype.getBinding=function(){return this._node},kr.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),Se.unbind(e,"keydown",this._keydownHandler,!0),Se.unbind(e,"keyup",this._keyupHandler,!0)),this._node=null},kr.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},kr.prototype.addListener=function(e,t,n){l(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Cr,e,t)},kr.prototype.removeListener=function(e,t){this._eventBus.off(t||Cr,e)},kr.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},kr.prototype.isCmd=_r,kr.prototype.isShift=Sr,kr.prototype.isKey=Ar;var Mr=["c","C",67],Pr=["v","V",86],Tr=["y","Y",89],Dr=["z","Z",90];function Or(e,t){var n=this;e.on("editorActions.init",500,(function(e){var i=e.editorActions;n.registerBindings(t,i)}))}Or.$inject=["eventBus","keyboard"],Or.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){var n=e.keyEvent;if(_r(n)&&!Sr(n)&&Ar(Dr,n))return t.trigger("undo"),!0})),n("redo",(function(e){var n=e.keyEvent;if(_r(n)&&(Ar(Tr,n)||Ar(Dr,n)&&Sr(n)))return t.trigger("redo"),!0})),n("copy",(function(e){var n=e.keyEvent;if(_r(n)&&Ar(Mr,n))return t.trigger("copy"),!0})),n("paste",(function(e){var n=e.keyEvent;if(_r(n)&&Ar(Pr,n))return t.trigger("paste"),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Ar(["+","Add","="],n)&&_r(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(Ar(["-","Subtract"],n)&&_r(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(Ar("0",n)&&_r(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(Ar(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};var Br={__init__:["keyboard","keyboardBindings"],keyboard:["type",kr],keyboardBindings:["type",Or]},Nr={moveSpeed:50,moveSpeedAccelerated:200};function Ir(e,t,n){var i=this;this._config=w({},Nr,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})}}Ir.$inject=["config.keyboardMove","keyboard","canvas"];var Lr={__depends__:[Br],__init__:["keyboardMove"],keyboardMove:["type",Ir]},Fr=/^djs-cursor-.*$/;function jr(e){var t=de(document.body);t.removeMatching(Fr),e&&t.add("djs-cursor-"+e)}function Vr(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zr(e,t){var n;function i(i){var r,a=n.start,o=n.button,s=ct(i),p=Vr(s,a);(!n.dragging&&(r=p,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===o&&function(e,t){function n(){return!1}t=t||"element.click",e.once(t,5e3,n)}(e),jr("grab")),n.dragging)&&(p=Vr(s,n.last||n.start),t.scroll({dx:p.x,dy:p.y}),n.last=s);i.preventDefault()}function r(e){Se.unbind(document,"mousemove",i),Se.unbind(document,"mouseup",r),n=null,jr(null)}e.on("element.mousedown",500,(function(e){return function(e){if(Ee(e.target,".djs-draggable"))return;var t=e.button;if(t>=2||e.ctrlKey||e.shiftKey||e.altKey)return;return n={button:t,start:ct(e)},Se.bind(document,"mousemove",i),Se.bind(document,"mouseup",r),!0}(e.originalEvent)})),this.isActive=function(){return!!n}}zr.$inject=["eventBus","canvas"];var Wr={__init__:["moveCanvas"],moveCanvas:["type",zr]};function Gr(e){return Math.log(e)/Math.log(10)}function $r(e,t){var n=Gr(e.min),i=Gr(e.max);return(Math.abs(n)+Math.abs(i))/t}var Hr=Math.sign||function(e){return e>=0?1:-1},Kr={min:.2,max:4};function Ur(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=x(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.init",(function(t){i._init(!1!==e.enabled)}))}Ur.$inject=["config.zoomScroll","eventBus","canvas"],Ur.prototype.scroll=function(e){this._canvas.scroll(e)},Ur.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Ur.prototype.zoom=function(e,t){var n=$r(Kr,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},Ur.prototype._handleWheel=function(e){if(!Ee(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))*Hr(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)}},Ur.prototype.stepZoom=function(e,t){var n=$r(Kr,10);this._zoom(e,t,n)},Ur.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,a=Gr(i.zoom()),o=Math.round(a/n)*n;o+=n*r;var s,p,l=Math.pow(10,o);i.zoom((s=Kr,p=l,Math.max(s.min,Math.min(s.max,p))),t)},Ur.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&Se[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Ur.prototype._init=function(e){this.toggle(e)};var qr={__init__:["zoomScroll"],zoomScroll:["type",Ur]};function Yr(e){wr.call(this,e)}n(Yr,wr),Yr.prototype._navigationModules=[Lr,Wr,qr],Yr.prototype._modules=[].concat(wr.prototype._modules,Yr.prototype._navigationModules);const Xr={camunda:{name:"Camunda",uri:"http://camunda.org/schema/1.0/bpmn",prefix:"camunda",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity","bpmn:SignalEventDefinition"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","camunda:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinitionExtension",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinitionExtension",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"ErrorEventDefinition",superClass:["bpmn:ErrorEventDefinition","Element"],properties:[{name:"expression",isAttr:!0,type:"String"}],meta:{allowedIn:["bpmn:ServiceTask"]}},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"camunda:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"},{name:"formRef",isAttr:!0,type:"String"},{name:"formRefBinding",isAttr:!0,type:"String"},{name:"formRefVersion",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Collaboration","bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"},{name:"modelerTemplateVersion",isAttr:!0,type:"Integer"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0}]},{name:"EscalationEventDefinitionExtension",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["camunda:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","camunda:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","camunda:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike","camunda:ExecutionListener","camunda:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["camunda:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["camunda:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0},{name:"id",type:"String",isAttr:!0},{name:"eventDefinitions",type:"bpmn:TimerEventDefinition",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinitionExtension",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvents",isAttr:!0,type:"String"}]}],emumerations:[]}};function Zr(e={}){e={...e,moddleExtensions:{...Xr,...e.moddleExtensions}},Yr.call(this,e)}return n(Zr,Yr),Zr}));
|