From 195f4e51862cd391597af1ee409f1625bf9fbb3a Mon Sep 17 00:00:00 2001 From: nitram509 Date: Sat, 27 Jan 2024 00:48:25 +0100 Subject: [PATCH] upgrade BPMN-JS v16.4.0 and fix rendering issues with swimlanes --- src/main/resources/public/css/bpmn-js.css | 145 +++++++++++++++ src/main/resources/public/js/app.js | 52 ++---- .../bpmn-navigated-viewer.production.min.js | 45 ++--- .../templates/components/bpmn-diagram.html | 176 +++++++++--------- .../resources/templates/layout/header.html | 1 + 5 files changed, 269 insertions(+), 150 deletions(-) create mode 100644 src/main/resources/public/css/bpmn-js.css diff --git a/src/main/resources/public/css/bpmn-js.css b/src/main/resources/public/css/bpmn-js.css new file mode 100644 index 00000000..ac1c97de --- /dev/null +++ b/src/main/resources/public/css/bpmn-js.css @@ -0,0 +1,145 @@ +.bjs-container { + --bjs-font-family: Arial, sans-serif; + + --color-grey-225-10-15: hsl(225, 10%, 15%); + --color-grey-225-10-35: hsl(225, 10%, 35%); + --color-grey-225-10-55: hsl(225, 10%, 55%); + --color-grey-225-10-75: hsl(225, 10%, 75%); + --color-grey-225-10-80: hsl(225, 10%, 80%); + --color-grey-225-10-85: hsl(225, 10%, 85%); + --color-grey-225-10-90: hsl(225, 10%, 90%); + --color-grey-225-10-95: hsl(225, 10%, 95%); + --color-grey-225-10-97: hsl(225, 10%, 97%); + + --color-blue-205-100-45: hsl(205, 100%, 45%); + --color-blue-205-100-45-opacity-30: hsla(205, 100%, 45%, 30%); + --color-blue-205-100-50: hsl(205, 100%, 50%); + --color-blue-205-100-95: hsl(205, 100%, 95%); + + --color-green-150-86-44: hsl(150, 86%, 44%); + + --color-red-360-100-40: hsl(360, 100%, 40%); + --color-red-360-100-45: hsl(360, 100%, 45%); + --color-red-360-100-92: hsl(360, 100%, 92%); + --color-red-360-100-97: hsl(360, 100%, 97%); + + --color-white: hsl(0, 0%, 100%); + --color-black: hsl(0, 0%, 0%); + --color-black-opacity-05: hsla(0, 0%, 0%, 5%); + --color-black-opacity-10: hsla(0, 0%, 0%, 10%); + + --breadcrumbs-font-family: var(--bjs-font-family); + --breadcrumbs-item-color: var(--color-blue-205-100-50); + --breadcrumbs-arrow-color: var(--color-black); + --drilldown-fill-color: var(--color-white); + --drilldown-background-color: var(--color-blue-205-100-50); +} + +.bjs-breadcrumbs { + position: absolute; + display: none; + flex-wrap: wrap; + align-items: center; + top: 30px; + left: 30px; + padding: 0px; + margin: 0px; + font-family: var(--breadcrumbs-font-family); + font-size: 16px; + line-height: normal; +} + +.bjs-breadcrumbs-shown .bjs-breadcrumbs { + display: flex; +} + +.djs-palette-shown .bjs-breadcrumbs { + left: 90px; +} + +.djs-palette-shown.djs-palette-two-column .bjs-breadcrumbs { + left: 140px; +} + +.bjs-breadcrumbs li { + display: inline-flex; + padding-bottom: 5px; + align-items: center; +} + +.bjs-breadcrumbs li a { + cursor: pointer; + color: var(--breadcrumbs-item-color); +} + +.bjs-breadcrumbs li:last-of-type a { + color: inherit; + cursor: default; +} + +.bjs-breadcrumbs li:not(:first-child)::before { + content: url('data:image/svg+xml;utf8,'); + padding: 0 8px; + color: var(--breadcrumbs-arrow-color); + height: 1em; +} + +.bjs-breadcrumbs .bjs-crumb { + display: inline-block; + max-width: 200px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.bjs-drilldown { + width: 20px; + height: 20px; + + padding: 0px; + margin-left: -20px; + + cursor: pointer; + border: none; + border-radius: 2px; + outline: none; + + fill: var(--drilldown-fill-color); + background-color: var(--drilldown-background-color); +} + +.bjs-drilldown-empty { + display: none; +} + +.selected .bjs-drilldown-empty { + display: inherit; +} + +[data-popup="align-elements"] .djs-popup-results { + display: flex; +} + +[data-popup="align-elements"] .djs-popup-body [data-group] + [data-group] { + border-left: 1px solid var(--popup-border-color); +} + +[data-popup="align-elements"] [data-group="align"] { + display: grid; + grid-template-columns: repeat(3, 1fr); +} + +[data-popup="align-elements"] .djs-popup-body .entry { + padding: 6px 8px; +} + +[data-popup="align-elements"] .djs-popup-body .entry:not(:first-child) { + margin-top: 0; +} + +[data-popup="align-elements"] .djs-popup-entry-icon { + display: block; + margin: 0; + height: 20px; + width: 20px; +} diff --git a/src/main/resources/public/js/app.js b/src/main/resources/public/js/app.js index 6e0cc328..89aba596 100644 --- a/src/main/resources/public/js/app.js +++ b/src/main/resources/public/js/app.js @@ -570,23 +570,6 @@ function getVariablesDocument() { // -------------------------------------------------------------------- -function loadDiagram(resource) { - viewer.importXML(resource, function (err) { - if (err) { - console.log('error rendering', err); - showError(err); - } else { - var canvas = viewer.get('canvas'); - - container.removeClass('with-error') - .addClass('with-diagram'); - - // zoom to fit full viewport - canvas.zoom('fit-viewport'); - } - }); -} - function addElementInstanceActiveMarker(canvas, elementId) { canvas.addMarker(elementId, 'bpmn-element-active'); } @@ -604,22 +587,27 @@ function removeElementSelectedMarker(elementId) { } function addElementInstanceCounter(overlays, elemenId, active, ended) { - var style = ((active > 0) ? "bpmn-badge-active" : "bpmn-badge-inactive"); - - overlays.add(elemenId, { - position: { - top: -25, - left: 0 - }, - html: '' - + active + ' | ' + ended - + '' - }); + try { + overlays.add(elemenId, 'note', { + position: { + top: -25, + left: 0 + }, + html: '' + + active + ' | ' + ended + + '' + }); + } catch (e) { + console.warn("Can't ad marker to element '"+elemenId+"',\n" + + "likely a known issue https://github.com/camunda-community-hub/zeebe-simple-monitor/issues/660\n" + + "error=" + e) + } } function addIncidentMarker(overlays, elemenId) { - overlays.add(elemenId, { + overlays.add(elemenId, 'note', { position: { top: -25, right: 10 @@ -633,17 +621,13 @@ function addIncidentMarker(overlays, elemenId) { function markSequenceFlow(elementRegistry, graphicsFactory, flow) { var element = elementRegistry.get(flow); var gfx = elementRegistry.getGraphics(element); - colorSequenceFlow(graphicsFactory, element, gfx, '#52b415'); } function colorSequenceFlow(graphicsFactory, sequenceFlow, gfx, color) { - var businessObject = sequenceFlow.businessObject, - di = businessObject.di; - + var di = sequenceFlow.di; di.set('stroke', color); di.set('fill', color); - graphicsFactory.update('connection', sequenceFlow, gfx); } diff --git a/src/main/resources/public/js/bpmn-navigated-viewer.production.min.js b/src/main/resources/public/js/bpmn-navigated-viewer.production.min.js index 8e531406..f562b6eb 100644 --- a/src/main/resources/public/js/bpmn-navigated-viewer.production.min.js +++ b/src/main/resources/public/js/bpmn-navigated-viewer.production.min.js @@ -1,29 +1,22 @@ -/*! bpmn-js - bpmn-navigated-viewer v6.5.1 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).BpmnJS=t()}(this,function(){"use strict";var e=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),t=Object.prototype.toString,n=Object.prototype.hasOwnProperty;function i(e){return void 0!==e}function r(e){return"[object Array]"===t.call(e)}function a(e){return"[object Object]"===t.call(e)}function o(e){return"[object Number]"===t.call(e)}function s(e){var n=t.call(e);return"[object Function]"===n||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n||"[object Proxy]"===n}function l(e){return"[object String]"===t.call(e)}function p(e,t){return n.call(e,t)}function c(e,t){var n;return t=function(e){return s(e)?e:function(t){return t===e}}(t),h(e,function(e,i){if(t(e,i))return n=e,!1}),n}function u(e,t){var n=[];return h(e,function(e,i){t(e,i)&&n.push(e)}),n}function h(e,t){var n;if(void 0!==e){var i=r(e)?g:y;for(var a in e)if(p(e,a)&&!1===t(n=e[a],i(a)))return n}}function m(e,t,n){return h(e,function(e,i){n=t(n,e,i)}),n}function f(e,t){return!!m(e,function(e,n,i){return e&&t(n,i)},!0)}function d(e){return function(t){return f(e,function(e,n){return t[n]===e})}}function y(e){return e}function g(e){return Number(e)}function v(e,t){return e.bind(t)}function x(){return(x=Object.assign||function(e){for(var t=1;t1?t-1:0),i=1;i"+e+"",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 G(e,t){var n;return"<"===e.charAt(0)?(n=z(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(V.svg,e),t&&T(n,t),n}var H=G("svg");function $(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function K(e){return e?H.createSVGTransformFromMatrix(e):H.createSVGTransform()}var U=/([&<>]{1})/g,q=/([\n\r"]{1})/g,Y={"&":"&","<":"<",">":">",'"':"'"};function X(e,t){return e.replace(t,function(e,t){return Y[t]||t})}function Z(e,t){var n,i,r,a,o;switch(e.nodeType){case 3:t.push(X(e.textContent,U));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n"),n=0,i=(o=e.childNodes).length;n")}else t.push("/>");break;case 8:t.push("\x3c!--",X(e.nodeValue,U),"--\x3e");break;case 4:t.push("");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function J(e,t){var n=z(t);if(function(e){for(var t;t=e.firstChild;)j(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
a',Te=!Ae.getElementsByTagName("link").length,Ae=void 0);var De={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:Te?[1,"X
","
"]:[0,"",""]};function Oe(e,t){return(t=t||document).querySelector(e)}function Be(e){e.parentNode&&e.parentNode.removeChild(e)}function Le(e,t,n){var i=K();i.setTranslate(t,n),te(e,i)}De.td=De.th=[3,"","
"],De.option=De.optgroup=[1,'"],De.thead=De.tbody=De.colgroup=De.caption=De.tfoot=[1,"","
"],De.polyline=De.ellipse=De.polygon=De.circle=De.text=De.line=De.path=De.rect=De.g=[1,'',""];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.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 Fe(e){if(!(this instanceof Fe))return new Fe(e);e=e||[128,36,1],this._seed=e.length?Ie.rack(e[0],e[1],e[2]):e}Fe.prototype.next=function(e){return this._seed(e||!0)},Fe.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},Fe.prototype.claim=function(e,t){this._seed.set(e,t||!0)},Fe.prototype.assigned=function(e){return this._seed.get(e)||!1},Fe.prototype.unclaim=function(e){delete this._seed.hats[e]},Fe.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var je=new Fe,Ve=10,We=3,ze=.95,Ge=.35;function He(e,t,n,i,r,o,s){w.call(this,t,s);var l=e&&e.defaultFillColor,p=e&&e.defaultStrokeColor,c=je.next(),u={},m=n.computeStyle;function f(e,t){var n=b({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),i=t.ref||{x:0,y:0},a=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var o=G("marker");T(t.element,n),k(o,t.element),T(o,{id:e,viewBox:"0 0 20 20",refX:i.x,refY:i.y,markerWidth:20*a,markerHeight:20*a,orient:"auto"});var s=Oe("defs",r._svg);s||(s=G("defs"),k(r._svg,s)),k(s,o),u[e]=o}function d(e){return e.replace(/[^0-9a-zA-z]+/g,"_")}function y(e,t,n){var i=e+"-"+d(t)+"-"+d(n)+"-"+c;return u[i]||function(e,t,n,i){if("sequenceflow-end"===t){var r=G("path");T(r,{d:"M 1 5 L 11 10 L 1 15 Z"}),f(e,{element:r,ref:{x:11,y:10},scale:.5,attrs:{fill:i,stroke:i}})}if("messageflow-start"===t){var a=G("circle");T(a,{cx:6,cy:6,r:3.5}),f(e,{element:a,attrs:{fill:n,stroke:i},ref:{x:6,y:6}})}if("messageflow-end"===t){var o=G("path");T(o,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),f(e,{element:o,attrs:{fill:n,stroke:i,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===t){var s=G("path");T(s,{d:"M 11 5 L 1 10 L 11 15"}),f(e,{element:s,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===t){var l=G("path");T(l,{d:"M 1 5 L 11 10 L 1 15"}),f(e,{element:l,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===t){var p=G("path");T(p,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),f(e,{element:p,attrs:{fill:n,stroke:i},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){var c=G("path");T(c,{d:"M 6 4 L 10 16"}),f(e,{element:c,attrs:{stroke:i},ref:{x:0,y:10},scale:.5})}}(i,e,t,n),"url(#"+i+")"}function g(e,t,n,i,r){a(i)&&(r=i,i=0),i=i||0,"none"===(r=m(r,{stroke:"black",strokeWidth:2,fill:"white"})).fill&&delete r.fillOpacity;var o=t/2,s=n/2,l=G("circle");return T(l,{cx:o,cy:s,r:Math.round((t+n)/4-i)}),T(l,r),k(e,l),l}function v(e,t,n,i,r,o){a(r)&&(o=r,r=0),r=r||0,o=m(o,{stroke:"black",strokeWidth:2,fill:"white"});var s=G("rect");return T(s,{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i}),T(s,o),k(e,s),s}function x(e,t,n){var i=re(t,n=m(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return k(e,i),i}function E(e,t,n){n=m(n,["no-fill"],{strokeWidth:2,stroke:"black"});var i=G("path");return T(i,{d:t}),T(i,n),k(e,i),i}function _(e,t,n,i){return E(t,n,b({"data-marker":e},i))}function C(e){return function(t,n){return L[e](t,n)}}function M(e){return L[e]}function P(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):ae(n,"bpmn:MessageEventDefinition")?M("bpmn:MessageEventDefinition")(t,e,i):ae(n,"bpmn:TimerEventDefinition")?M("bpmn:TimerEventDefinition")(t,e,i):ae(n,"bpmn:ConditionalEventDefinition")?M("bpmn:ConditionalEventDefinition")(t,e):ae(n,"bpmn:SignalEventDefinition")?M("bpmn:SignalEventDefinition")(t,e,i):ae(n,"bpmn:EscalationEventDefinition")?M("bpmn:EscalationEventDefinition")(t,e,i):ae(n,"bpmn:LinkEventDefinition")?M("bpmn:LinkEventDefinition")(t,e,i):ae(n,"bpmn:ErrorEventDefinition")?M("bpmn:ErrorEventDefinition")(t,e,i):ae(n,"bpmn:CancelEventDefinition")?M("bpmn:CancelEventDefinition")(t,e,i):ae(n,"bpmn:CompensateEventDefinition")?M("bpmn:CompensateEventDefinition")(t,e,i):ae(n,"bpmn:TerminateEventDefinition")?M("bpmn:TerminateEventDefinition")(t,e,i):null}function N(e,t,n){n=b({size:{width:100}},n);var i=o.createText(t||"",n);return I(i).add("djs-label"),k(e,i),i}function D(e,t,n){return N(e,se(t).name,{box:t,align:n,padding:5,style:{fill:pe(t,p)}})}function O(e,t,n){!function(e,t,n,i,r){var a=K();a.setTranslate(t,n);var o=K();o.setRotate(i||0,0,0);var s=K();s.setScale(r||1,r||1),te(e,[a,o,s])}(N(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:pe(n,p)}}),0,-(-1*n.height),270)}function B(e){for(var t=e.waypoints,n="m "+t[0].x+","+t[0].y,i=1;i1)for(;n=i.shift();){if(!(n.length+ae?t.width:e},0),g=o.top;"middle"===r.vertical&&(g+=(n.height-d)/2),g-=(l||c[0].height)/4;var v=G("text");return T(v,i),h(c,function(e){var t;switch(g+=l||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(s?y:u)-o.right-e.width;break;default:t=Math.max(((s?y:u)-e.width)/2+o.left,0)}var n=G("tspan");T(n,{x:t,y:g}),n.textContent=e.text,k(v,n)}),j(f),{dimensions:{width:y,height:d},element:v}};var Je=12,Qe=1.2,et=30;function tt(e){var t=b({fontFamily:"Arial, sans-serif",fontSize:Je,fontWeight:"normal",lineHeight:Qe},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=b({},t,{fontSize:n},e&&e.externalStyle||{}),r=new Ze({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(et,Math.round(i.height))}},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}tt.$inject=["config.textRenderer"];var nt=/\{([^}]+)\}/g,it=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var rt={__init__:["bpmnRenderer"],bpmnRenderer:["type",He],textRenderer:["type",tt],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m {mx}, {my} m 0 15 l 0 -15 m 4 15 l 0 -15 m 4 15 l 0 -15 ",height:61,width:51,heightElements:[12],widthElements:[1,6,12,15]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var a,o,s={};if(t.position){for(var l=t.containerHeight/r.height*t.yScaleFactor,p=t.containerWidth/r.width*t.xScaleFactor,c=0;ct===e}function x(e){return e}function w(e){return Number(e)}function b(e,t){return e.bind(t)}function E(e,...t){return Object.assign(e,...t)}var _=1e3;function A(e,t){var n=this;t=t||_,e.on(["render.shape","render.connection"],t,(function(e,t){var i=e.type,r=t.element,o=t.gfx,a=t.attrs;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r,a):n.drawConnection(o,r,a)})),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 k(e,t){var n=R(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function R(e){return e&&e.businessObject||e}function S(e){return e&&e.di}function C(e,t){return!k(e,"bpmn:CallActivity")&&(k(e,"bpmn:SubProcess")?!(!(t=t||S(e))||!k(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!k(e,"bpmn:Participant")||!!R(e).processRef)}function M(e){if(k(e,"bpmn:Participant")||k(e,"bpmn:Lane")){var t=S(e).isHorizontal;return void 0===t||t}}A.prototype.canRender=function(e){},A.prototype.drawShape=function(e,t){},A.prototype.drawConnection=function(e,t){},A.prototype.getShapePath=function(e){},A.prototype.getConnectionPath=function(e){};var P={width:90,height:20},N=15;function T(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),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,s=r.y;return Math.abs(o)"+e+"",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 Y(e,t){var n;return"<"===e.charAt(0)?(n=q(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(K.svg,e),t&&V(n,t),n}var X=null;function Z(){return null===X&&(X=Y("svg")),X}function J(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function Q(e){return e?Z().createSVGTransformFromMatrix(e):Z().createSVGTransform()}var ee=/([&<>]{1})/g,te=/([\n\r"]{1})/g,ne={"&":"&","<":"<",">":">",'"':"'"};function ie(e,t){return e.replace(t,(function(e,t){return ne[t]||t}))}function re(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(ie(e.textContent,ee));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n"),n=0,i=(a=e.childNodes).length;n")}else t.push("/>");break;case 8:t.push("\x3c!--",ie(e.nodeValue,ee),"--\x3e");break;case 4:t.push("");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function oe(e,t){var n=q(t);if(H(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)),o=0;o
a',Ye=!Ke.getElementsByTagName("link").length,Ke=void 0);var Xe={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:Ye?[1,"X
","
"]:[0,"",""]};Xe.td=Xe.th=[3,"","
"],Xe.option=Xe.optgroup=[1,'"],Xe.thead=Xe.tbody=Xe.colgroup=Xe.caption=Xe.tfoot=[1,"","
"],Xe.polyline=Xe.ellipse=Xe.polygon=Xe.circle=Xe.text=Xe.line=Xe.path=Xe.rect=Xe.g=[1,'',""];var Ze=qe;function Je(e,t){return(t=t||document).querySelector(e)}function Qe(e){e.parentNode&&e.parentNode.removeChild(e)}function et(e,t,n,i,r){var o=Q();o.setTranslate(t,n);var a=Q();a.setRotate(i||0,0,0);var s=Q();s.setScale(r||1,r||1),le(e,[o,a,s])}function tt(e,t,n){var i=Q();i.setTranslate(t,n),le(e,i)}var nt=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 o=i-Math.floor(i),a="";for(r=0;r=Math.pow(2,e)?t(e,n):a};t.rack=function(e,n,i){var r=function(r){var a=0;do{if(a++>10){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var s=t(e,n)}while(Object.hasOwnProperty.call(o,s));return o[s]=r,s},o=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 it(e){if(!(this instanceof it))return new it(e);e=e||[128,36,1],this._seed=e.length?nt.rack(e[0],e[1],e[2]):e}it.prototype.next=function(e){return this._seed(e||!0)},it.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},it.prototype.claim=function(e,t){this._seed.set(e,t||!0)},it.prototype.assigned=function(e){return this._seed.get(e)||!1},it.prototype.unclaim=function(e){delete this._seed.hats[e]},it.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var rt=new it,ot=.95;function at(e,t,n,i,r,o,s){A.call(this,t,s);var l=e&&e.defaultFillColor,p=e&&e.defaultStrokeColor,c=e&&e.defaultLabelColor,u=rt.next(),h={};function m(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:ye,strokeWidth:2,fill:"white"})}function d(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:ye,strokeWidth:2})}function y(e,t){var{ref:n={x:0,y:0},scale:i=1,element:o}=t,a=Y("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});L(a,o);var s=Je("defs",r._svg);s||(s=Y("defs"),L(r._svg,s)),L(s,a),h[e]=a}function g(e){return e.replace(/[^0-9a-zA-Z]+/g,"_")}function v(e,t,n){var i=e+"-"+g(t)+"-"+g(n)+"-"+u;return h[i]||function(e,t,n,i){if("sequenceflow-end"===t){y(e,{element:Y("path",{d:"M 1 5 L 11 10 L 1 15 Z",...m({fill:i,stroke:i,strokeWidth:1})}),ref:{x:11,y:10},scale:.5})}if("messageflow-start"===t){y(e,{element:Y("circle",{cx:6,cy:6,r:3.5,...m({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6}})}if("messageflow-end"===t){y(e,{element:Y("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...m({fill:n,stroke:i,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5}})}if("association-start"===t){y(e,{element:Y("path",{d:"M 11 5 L 1 10 L 11 15",...d({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5})}if("association-end"===t){y(e,{element:Y("path",{d:"M 1 5 L 11 10 L 1 15",...d({fill:"none",stroke:i,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5})}if("conditional-flow-marker"===t){y(e,{element:Y("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...m({fill:n,stroke:i})}),ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){y(e,{element:Y("path",{d:"M 6 4 L 10 16",...m({stroke:i})}),ref:{x:0,y:10},scale:.5})}}(i,e,t,n),"url(#"+i+")"}function x(e,t,n,i,r={}){a(i)&&(r=i,i=0),i=i||0,r=m(r);var o=Y("circle",{cx:t/2,cy:n/2,r:Math.round((t+n)/4-i),...r});return L(e,o),o}function w(e,t,n,i,r,o){a(r)&&(o=r,r=0),r=r||0,o=m(o);var s=Y("rect",{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i,...o});return L(e,s),s}function b(e,t,n,i){var r=me(t,n=d(n),i);return L(e,r),r}function _(e,t,n){return b(e,t,n,5)}function P(e,t,n){n=d(n);var i=Y("path",{...n,d:t});return L(e,i),i}function N(e,t,n,i){return P(t,n,E({"data-marker":e},i))}function T(e){return de[e]}function O(e){return function(t,n,i){return T(e)(t,n,i)}}var B=function(e,t,n={},r){return P(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{fill:r?we(t,p,n.stroke):xe(t,l,n.fill),stroke:r?xe(t,l,n.fill):we(t,p,n.stroke),strokeWidth:1})},I=function(e,t,n={}){var r=x(e,t.width,t.height,.2*t.height,{fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:2});P(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{stroke:we(t,p,n.stroke),strokeWidth:2});for(var o=0;o<12;o++){var a=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),s=t.width/2,c=t.height/2;P(e,a,{strokeWidth:1,stroke:we(t,p,n.stroke),transform:"rotate("+30*o+","+c+","+s+")"})}return r},j=function(e,t,n={},r){return P(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{fill:r?we(t,p,n.stroke):xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:1})},F=function(e,t,n={}){return P(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:1})},W=function(e,t,n={},r){return P(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:r?we(t,p,n.stroke):xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:1})},$=function(e,t,n={},r){return P(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{fill:r?we(t,p,n.stroke):xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:1})},G=function(e,t,n={},r){var o=P(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:r?we(t,p,n.stroke):"none",stroke:we(t,p,n.stroke),strokeWidth:1});return function(e,t){var n=Q();n.setRotate(t,0,0),le(e,n)}(o,45),o},H=function(e,t,n={},r){return P(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{fill:r?we(t,p,n.stroke):xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:1})},K=function(e,t,n={},r){return P(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:r?we(t,p,n.stroke):xe(t,l,n.fill),stroke:we(t,p,n.stroke)})},U=function(e,t,n={},r){return P(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{fill:r?we(t,p,n.stroke):xe(t,l,n.fill),strokeWidth:1})},q=function(e,t,n={}){return P(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{fill:we(t,p,n.stroke),stroke:we(t,p,n.stroke),strokeWidth:1})},X=function(e,t,n={}){return x(e,t.width,t.height,8,{fill:we(t,p,n.stroke),stroke:we(t,p,n.stroke),strokeWidth:4})};function Z(e,t,n={}){var i=R(e),r=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(i);return i.get("eventDefinitions")&&i.get("eventDefinitions").length>1?i.get("parallelMultiple")?q(t,e,n,r):U(t,e,n,r):ve(i,"bpmn:MessageEventDefinition")?B(t,e,n,r):ve(i,"bpmn:TimerEventDefinition")?I(t,e,n,r):ve(i,"bpmn:ConditionalEventDefinition")?F(t,e,n,r):ve(i,"bpmn:SignalEventDefinition")?K(t,e,n,r):ve(i,"bpmn:EscalationEventDefinition")?j(t,e,n,r):ve(i,"bpmn:LinkEventDefinition")?W(t,e,n,r):ve(i,"bpmn:ErrorEventDefinition")?$(t,e,n,r):ve(i,"bpmn:CancelEventDefinition")?G(t,e,n,r):ve(i,"bpmn:CompensateEventDefinition")?H(t,e,n,r):ve(i,"bpmn:TerminateEventDefinition")?X(t,e,n,r):null}var J={ParticipantMultiplicityMarker:function(e,t,n={}){var r=_e(t,n),o=Ae(t,n);N("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2-6)/r,my:(o-15)/o}}),{strokeWidth:2,fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke)})},SubProcessMarker:function(e,t,n={}){tt(w(e,14,14,0,{strokeWidth:1,fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke)}),t.width/2-7.5,t.height-20),N("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:xe(t,l,n.fill),stroke:we(t,p,n.stroke)})},ParallelMarker:function(e,t,n){var r=_e(t,n),o=Ae(t,n);N("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.parallel)/r,my:(o-20)/o}}),{fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke)})},SequentialMarker:function(e,t,n){N("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:xe(t,l,n.fill),stroke:we(t,p,n.stroke)})},CompensationMarker:function(e,t,n){N("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:xe(t,l,n.fill),stroke:we(t,p,n.stroke)})},LoopMarker:function(e,t,n){var r=_e(t,n),o=Ae(t,n);N("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.loop)/r,my:(o-7)/o}}),{strokeWidth:1.5,fill:"none",stroke:we(t,p,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=_e(t,n),o=Ae(t,n);N("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.adhoc)/r,my:(o-15)/o}}),{strokeWidth:1,fill:we(t,p,n.stroke),stroke:we(t,p,n.stroke)})}};function ee(e,t,n,i){J[e](t,n,i)}function te(e,t,n,i={}){i={fill:i.fill,stroke:i.stroke,width:_e(t,i),height:Ae(t,i)};var r=R(t),o=n&&n.includes("SubProcessMarker");i=o?{...i,seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{...i,seq:-5,parallel:-6,compensation:-27,loop:0,adhoc:10},f(n,(function(n){ee(n,e,t,i)})),r.get("isForCompensation")&&ee("CompensationMarker",e,t,i),k(r,"bpmn:AdHocSubProcess")&&ee("AdhocMarker",e,t,i);var a=r.get("loopCharacteristics"),s=a&&a.get("isSequential");a&&(void 0===s&&ee("LoopMarker",e,t,i),!1===s&&ee("ParallelMarker",e,t,i),!0===s&&ee("SequentialMarker",e,t,i))}function ne(e,t,n={}){n=E({size:{width:100}},n);var i=o.createText(t||"",n);return z(i).add("djs-label"),L(e,i),i}function ie(e,t,n,i={}){var r=R(t),o=Ee({x:t.x,y:t.y,width:t.width,height:t.height},i);return ne(e,r.name,{align:n,box:o,padding:7,style:{fill:be(t,c,p,i.stroke)}})}function re(e,t,n,i={}){var r=M(n),o=ne(e,t,{box:{height:30,width:r?Ae(n,i):_e(n,i)},align:"center-middle",style:{fill:be(n,c,p,i.stroke)}});r&&et(o,0,-(-1*Ae(n,i)),270)}function oe(e,t,n={}){var{width:i,height:r}=Ee(t,n);return w(e,i,r,10,{...n,fill:xe(t,l,n.fill),fillOpacity:ot,stroke:we(t,p,n.stroke)})}function ae(e,t,n={}){var i=R(t),r=xe(t,l,n.fill),o=we(t,p,n.stroke);return"One"!==i.get("associationDirection")&&"Both"!==i.get("associationDirection")||(n.markerEnd=v("association-end",r,o)),"Both"===i.get("associationDirection")&&(n.markerStart=v("association-start",r,o)),n=st(n,["markerStart","markerEnd"]),_(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function se(e,t,n={}){var r=xe(t,l,n.fill),o=we(t,p,n.stroke),a=P(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:r,fillOpacity:ot,stroke:o});(function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection})(R(t))&&P(e,i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:(t.height-18)/t.height}}),{strokeWidth:2,fill:r,stroke:o});return a}function pe(e,t,n={}){return x(e,t.width,t.height,{fillOpacity:ot,...n,fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke)})}function ce(e,t,n={}){return function(e,t,n,i){var r=t/2,o=n/2,a=[{x:r,y:0},{x:t,y:o},{x:r,y:n},{x:0,y:o}].map((function(e){return e.x+","+e.y})).join(" ");i=m(i);var s=Y("polygon",{...i,points:a});return L(e,s),s}(e,t.width,t.height,{fill:xe(t,l,n.fill),fillOpacity:ot,stroke:we(t,p,n.stroke)})}function ue(e,t,n={}){var i=w(e,_e(t,n),Ae(t,n),0,{fill:xe(t,l,n.fill),fillOpacity:n.fillOpacity||ot,stroke:we(t,p,n.stroke),strokeWidth:1.5}),r=R(t);k(r,"bpmn:Lane")&&re(e,r.get("name"),t,n);return i}function he(e,t,n={}){var i=oe(e,t,n);(function(e){return e&&!!R(e).triggeredByEvent})(t)&&V(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5});var r=C(t);return ie(e,t,r?"center-top":"center-middle",n),te(e,t,r?void 0:["SubProcessMarker"],n),i}function fe(e,t,n={}){var i=oe(e,t,n);return ie(e,t,"center-middle",n),te(e,t,void 0,n),i}var de=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return he(e,t,n=C(t)?st(n,["fill","stroke","width","height"]):st(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return ae(e,t,n=st(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=st(n,["fill","stroke"]);var r=R(t).get("cancelActivity");n={strokeWidth:1.5,fill:xe(t,l,n.fill),fillOpacity:1,stroke:we(t,p,n.stroke)},r||(n.strokeDasharray="6");var o=pe(e,t,n);return x(e,t.width,t.height,3,{...n,fill:"none"}),i&&Z(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var r=fe(e,t,n=st(n,["fill","stroke"]));return V(P(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:1}),V(P(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:we(t,p,n.stroke),stroke:we(t,p,n.stroke),strokeWidth:1}),r},"bpmn:CallActivity":function(e,t,n={}){return n=st(n,["fill","stroke"]),he(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var r=ce(e,t,n=st(n,["fill","stroke"]));return P(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:we(t,p,n.stroke),stroke:we(t,p,n.stroke),strokeWidth:1}),r},"bpmn:DataInput":function(e,t,n={}){n=st(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=se(e,t,n);return P(e,r,{fill:"none",stroke:we(t,p,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=st(n,["fill","stroke"]),ae(e,t,{...n,markerEnd:v("association-end",xe(t,l,n.fill),we(t,p,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return se(e,t,n=st(n,["fill","stroke"]))},"bpmn:DataObjectReference":O("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=st(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=se(e,t,n);return P(e,r,{strokeWidth:1,fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=st(n,["fill","stroke"]),ae(e,t,{...n,markerEnd:v("association-end",xe(t,l,n.fill),we(t,p,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=st(n,["fill","stroke"]),P(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:xe(t,l,n.fill),fillOpacity:ot,stroke:we(t,p,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=st(n,["fill","stroke"]);var r=pe(e,t,{...n,strokeWidth:4});return i&&Z(t,e,n),r},"bpmn:EventBasedGateway":function(e,t,n={}){n=st(n,["fill","stroke"]);var r=R(t),o=ce(e,t,n);x(e,t.width,t.height,.2*t.height,{fill:xe(t,"none",n.fill),stroke:we(t,p,n.stroke),strokeWidth:1});var a=r.get("eventGatewayType"),s=!!r.get("instantiate");if("Parallel"===a){var l=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});P(e,l,{fill:"none",stroke:we(t,p,n.stroke),strokeWidth:1})}else"Exclusive"===a&&(s||x(e,t.width,t.height,.26*t.height,{fill:"none",stroke:we(t,p,n.stroke),strokeWidth:1}),function(){var r=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});P(e,r,{fill:"none",stroke:we(t,p,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var r=ce(e,t,n=st(n,["fill","stroke"])),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return S(t).get("isMarkerVisible")&&P(e,o,{fill:we(t,p,n.stroke),stroke:we(t,p,n.stroke),strokeWidth:1}),r},"bpmn:Gateway":function(e,t,n={}){return ce(e,t,n=st(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=st(n,["fill","stroke","width","height"]),w(e,t.width,t.height,10,{stroke:we(t,p,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:_e(t,n),height:Ae(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var i=ce(e,t,n=st(n,["fill","stroke"]));return x(e,t.width,t.height,.24*t.height,{fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:2.5}),i},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=st(n,["fill","stroke"]);var r=pe(e,t,{...n,strokeWidth:1.5});return x(e,t.width,t.height,3,{fill:"none",stroke:we(t,p,n.stroke),strokeWidth:1.5}),i&&Z(t,e,n),r},"bpmn:IntermediateCatchEvent":O("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":O("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=st(n,["fill","stroke","width","height"]),ue(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var r=fe(e,t,n=st(n,["fill","stroke"]));return P(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:.5}),r},"bpmn:MessageFlow":function(e,t,n={}){n=st(n,["fill","stroke"]);var r=R(t),o=S(t),a=xe(t,l,n.fill),s=we(t,p,n.stroke),c=_(e,t.waypoints,{markerEnd:v("messageflow-end",a,s),markerStart:v("messageflow-start",a,s),stroke:s,strokeDasharray:"10, 11",strokeWidth:1.5});if(r.get("messageRef")){var u=c.getPointAtLength(c.getTotalLength()/2),h=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),f={strokeWidth:1};"initiating"===o.get("messageVisibleKind")?(f.fill=a,f.stroke=s):(f.fill=s,f.stroke=a);var m=P(e,h,f),d=ne(e,r.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:s}}),y=m.getBBox(),g=d.getBBox();et(d,u.x-g.width/2,u.y+y.height/2+10,0)}return c},"bpmn:ParallelGateway":function(e,t,n={}){var r=ce(e,t,n=st(n,["fill","stroke"]));return P(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:we(t,p,n.stroke),stroke:we(t,p,n.stroke),strokeWidth:1}),r},"bpmn:Participant":function(e,t,n={}){var i=ue(e,t,n=st(n,["fill","stroke","width","height"])),r=C(t),o=M(t),a=R(t),s=a.get("name");if(r){b(e,o?[{x:30,y:0},{x:30,y:Ae(t,n)}]:[{x:0,y:30},{x:_e(t,n),y:30}],{stroke:we(t,p,n.stroke),strokeWidth:1.5}),re(e,s,t,n)}else{var l=Ee(t,n);o||(l.height=_e(t,n),l.width=Ae(t,n));var u=ne(e,s,{box:l,align:"center-middle",style:{fill:be(t,c,p,n.stroke)}});if(!o)et(u,0,-(-1*Ae(t,n)),270)}return a.get("participantMultiplicity")&&ee("ParticipantMultiplicityMarker",e,t,n),i},"bpmn:ReceiveTask":function(e,t,n={}){n=st(n,["fill","stroke"]);var r,o=R(t),a=fe(e,t,n);return o.get("instantiate")?(x(e,28,28,4.4,{fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:1}),r=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):r=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),P(e,r,{fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:1}),a},"bpmn:ScriptTask":function(e,t,n={}){var r=fe(e,t,n=st(n,["fill","stroke"]));return P(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:1}),r},"bpmn:SendTask":function(e,t,n={}){var r=fe(e,t,n=st(n,["fill","stroke"]));return P(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:we(t,p,n.stroke),stroke:xe(t,l,n.fill),strokeWidth:1}),r},"bpmn:SequenceFlow":function(e,t,n={}){n=st(n,["fill","stroke"]);var i=xe(t,l,n.fill),r=we(t,p,n.stroke),o=_(e,t.waypoints,{markerEnd:v("sequenceflow-end",i,r),stroke:r}),a=R(t),{source:s}=t;if(s){var c=R(s);a.get("conditionExpression")&&k(c,"bpmn:Activity")&&V(o,{markerStart:v("conditional-flow-marker",i,r)}),c.get("default")&&(k(c,"bpmn:Gateway")||k(c,"bpmn:Activity"))&&c.get("default")===a&&V(o,{markerStart:v("conditional-default-flow-marker",i,r)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var r=fe(e,t,n=st(n,["fill","stroke"]));return x(e,10,10,{fill:xe(t,l,n.fill),stroke:"none",transform:"translate(6, 6)"}),P(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:1}),x(e,10,10,{fill:xe(t,l,n.fill),stroke:"none",transform:"translate(11, 10)"}),P(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:1}),r},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=st(n,["fill","stroke"]),R(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var r=pe(e,t,n);return i&&Z(t,e,n),r},"bpmn:SubProcess":function(e,t,n={}){return he(e,t,n=C(t)?st(n,["fill","stroke","width","height"]):st(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return fe(e,t,n=st(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=st(n,["fill","stroke","width","height"]);var{width:r,height:o}=Ee(t,n),a=w(e,r,o,0,0,{fill:"none",stroke:"none"});return P(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:0,my:0}}),{stroke:we(t,p,n.stroke)}),ne(e,R(t).get("text")||"",{align:"left-top",box:Ee(t,n),padding:7,style:{fill:be(t,c,p,n.stroke)}}),a},"bpmn:Transaction":function(e,t,i={}){i=C(t)?st(i,["fill","stroke","width","height"]):st(i,["fill","stroke"]);var r=he(e,t,{strokeWidth:1.5,...i}),o=n.style(["no-fill","no-events"],{stroke:we(t,p,i.stroke),strokeWidth:1.5});return C(t)||(i={}),w(e,_e(t,i),Ae(t,i),7,3,o),r},"bpmn:UserTask":function(e,t,n={}){var r=fe(e,t,n=st(n,["fill","stroke"]));return P(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:.5}),P(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:xe(t,l,n.fill),stroke:we(t,p,n.stroke),strokeWidth:.5}),P(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:we(t,p,n.stroke),stroke:we(t,p,n.stroke),strokeWidth:.5}),r},label:function(e,t,n={}){return function(e,t,n={}){var i={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return ne(e,D(t),{box:i,fitBox:!0,style:E({},o.getExternalStyle(),{fill:be(t,c,p,n.stroke)})})}(e,t,n)}};this._drawPath=P,this._renderer=T}function st(e,t=[]){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}e(at,A),at.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],at.prototype.canRender=function(e){return k(e,"bpmn:BaseElement")},at.prototype.drawShape=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},at.prototype.drawConnection=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},at.prototype.getShapePath=function(e){return k(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,pe([["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"]])):k(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return pe([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-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-o],["a",t,t,0,0,1,t,-t],["z"]])}(e,10):k(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return pe([["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 pe([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var lt=0,pt={width:150,height:50};function ct(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 ut(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=ct(o,n)).width=o?i.width:0," "===o||""===o||i.width1)for(;n=i.shift();){if(!(n.length+oe?t.width:e}),0),g=o.top;"middle"===r.vertical&&(g+=(n.height-d)/2),g-=(l||c[0].height)/4;var v=Y("text");return V(v,i),f(c,(function(e){var t;switch(g+=l||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(s?y:u)-o.right-e.width;break;default:t=Math.max(((s?y:u)-e.width)/2+o.left,0)}var n=Y("tspan");V(n,{x:t,y:g}),n.textContent=e.text,L(v,n)})),G(h),{dimensions:{width:y,height:d},element:v}};function yt(e){var t=E({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=E({},t,{fontSize:n},e&&e.externalStyle||{}),r=new dt({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30},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}}yt.$inject=["config.textRenderer"];var gt=/\{([^{}]+)\}/g,vt=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var xt={__init__:["bpmnRenderer"],bpmnRenderer:["type",at],textRenderer:["type",yt],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 o={};if(t.position){for(var a=t.containerHeight/r.height*t.yScaleFactor,s=t.containerWidth/r.width*t.xScaleFactor,l=0;l':""}function Rt(e,t,n){return E({id:e.id,type:e.$type,businessObject:e,di:t},n)}function St(e,t,n){var i=e.waypoint;return!i||i.length<2?[At(t),At(n)]:i.map((function(e){return{x:e.x,y:e.y}}))}function Ct(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:kt(n),referenced:kt(t),property:i}))}function Mt(e,t,n,i,r,o){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}Mt.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],Mt.prototype.add=function(e,t,n){var i,r,o,a,s,l,p,c=this._translate;if(k(t,"bpmndi:BPMNPlane")){var u=k(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(Rt(e,t,u)),this._canvas.addRootElement(i)}else if(k(t,"bpmndi:BPMNShape")){var h=!C(e,t),f=function(e){return k(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var m=t.bounds;i=this._elementFactory.createShape(Rt(e,t,{collapsed:h,hidden:r,x:Math.round(m.x),y:Math.round(m.y),width:Math.round(m.width),height:Math.round(m.height),isFrame:f})),k(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),k(e,"bpmn:Lane")&&(o=0),k(e,"bpmn:DataStoreReference")&&(a=n,s=At(m),l=s.x,p=s.y,l>=a.x&&l<=a.x+a.width&&p>=a.y&&p<=a.y+a.height||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!k(t,"bpmndi:BPMNEdge"))throw new Error(c("unknown di {di} for element {semantic}",{di:kt(t),semantic:kt(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:St(t,d,y)})),k(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return function(e){return k(e,"bpmn:Event")||k(e,"bpmn:Gateway")||k(e,"bpmn:DataStoreReference")||k(e,"bpmn:DataObjectReference")||k(e,"bpmn:DataInput")||k(e,"bpmn:DataOutput")||k(e,"bpmn:SequenceFlow")||k(e,"bpmn:MessageFlow")||k(e,"bpmn:Group")}(e)&&D(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},Mt.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:kt(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw Ct(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),-1===o.indexOf(t)&&o.push(t)},Mt.prototype.addLabel=function(e,t,n){var i,r,o;return i=O(t,n),(r=D(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(Rt(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!D(n),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,n.parent)},Mt.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type,o=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?Ct(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:kt(e),side:t}))},Mt.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},Mt.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},Mt.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var Pt={__depends__:[xt,{__depends__:[wt],bpmnImporter:["type",Mt]}]};function Nt(e){return e.originalEvent||e.srcEvent}function Tt(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 Ot(){return/mac/i.test(navigator.platform)}function Dt(e,t){return(Nt(e)||e).button===t}function Bt(e){return Dt(e,0)}function Lt(e){return!0}function It(e){return Bt(e)||function(e){return Dt(e,1)}(e)}function jt(e,t,n){var i=this;function r(n,i,r){var o,a;(function(e,t){var n=l[e]||Bt;return!n(t)})(n,i)||(r?a=t.getGraphics(r):(o=i.delegateTarget||i.target)&&(a=o,r=t.get(a)),a&&r&&!1===e.fire(n,{element:r,gfx:a,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function a(e){return o[e]}var s={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":Lt,"element.mousedown":It,"element.mouseup":It,"element.click":It,"element.dblclick":It};var p="svg, .djs-element";function c(e,t,n,i){var a=o[n]=function(e){r(n,e)};i&&(l[n]=i),a.$delegate=Ue.bind(e,p,t,a)}function u(e,t,n){var i=a(n);i&&Ue.unbind(e,t,i.$delegate)}e.on("canvas.destroy",(function(e){var t;t=e.svg,f(s,(function(e,n){u(t,n,e)}))})),e.on("canvas.init",(function(e){var t;t=e.svg,f(s,(function(e,n){c(t,n,e)}))})),e.on(["shape.added","connection.added"],(function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:i})})),e.on(["shape.changed","connection.changed"],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 h=y("djs-hit djs-hit-stroke"),m=y("djs-hit djs-hit-click-stroke"),d={all:y("djs-hit djs-hit-all"),"click-stroke":m,stroke:h,"no-move":y("djs-hit djs-hit-no-move")};function y(e,t){return t=E({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function g(e,t){var n=d[t];if(!n)throw new Error("invalid hit type <"+t+">");return V(e,n),e}function v(e,t){L(e,t)}this.removeHits=function(e){var t;f((t=".djs-hit",(e||document).querySelectorAll(t)),G)},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=me(t);return g(n,"stroke"),v(e,n),n},this.createBoxHit=function(e,t,n){n=E({x:0,y:0},n);var i=Y("rect");return g(i,t),V(i,n),v(e,i),i},this.updateDefaultHit=function(e,t){var n=Je(".djs-hit",t);if(n)return e.waypoints?de(n,e.waypoints):V(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=a,this.registerEvent=c,this.unregisterEvent=u}jt.$inject=["eventBus","elementRegistry","styles"];var Ft={__init__:["interactionEvents"],interactionEvents:["type",jt]};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,l=o.y,p=o.height||0,c=o.width||0;(sr||void 0===r)&&(r=s+c),(l+p>a||void 0===a)&&(a=l+p)})),{x:n,y:i,height:a-i,width:r-n}}function Wt(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function zt(e){return!(!e||!e.isFrame)}function $t(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),i=this;function r(e){var t=Y("rect");return V(t,E({x:0,y:0,rx:4,width:100,height:100},n)),t}e.on(["shape.added","shape.changed"],500,(function(e){var t=e.element,n=e.gfx,o=Je(".djs-outline",n);o||L(n,o=i.getOutline(t)||r()),i.updateShapeOutline(o,t)})),e.on(["connection.added","connection.changed"],(function(e){var t=e.element,n=e.gfx,o=Je(".djs-outline",n);o||L(n,o=r()),i.updateConnectionOutline(o,t)}))}$t.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&f(i,(function(i){n=n||i.updateOutline(t,e)})),n||V(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},$t.prototype.updateConnectionOutline=function(e,t){var n=Vt(t);V(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},$t.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("outline.getProviders",e,(function(e){e.providers.push(t)}))},$t.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},$t.prototype.getOutline=function(e){var t;return f(this._getProviders(),(function(n){l(n.getOutline)&&(t=t||n.getOutline(e))})),t},$t.$inject=["eventBus","styles","elementRegistry"];var Gt={__init__:["outline"],outline:["type",$t]};function Ht(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)}))}Ht.$inject=["eventBus","canvas"],Ht.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},Ht.prototype.get=function(){return this._selectedElements},Ht.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Ht.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();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 Kt="hover",Ut="selected";function qt(e,t,n){this._canvas=e;var i=this;function r(t,n){e.addMarker(t,n)}function o(t,n){e.removeMarker(t,n)}this._multiSelectionBox=null,t.on("element.hover",(function(e){r(e.element,Kt)})),t.on("element.out",(function(e){o(e.element,Kt)})),t.on("selection.changed",(function(e){var t=e.oldSelection,n=e.newSelection;f(t,(function(e){-1===n.indexOf(e)&&o(e,Ut)})),f(n,(function(e){-1===t.indexOf(e)&&r(e,Ut)})),i._updateSelectionOutline(n)})),t.on("element.changed",(function(e){n.isSelected(e.element)&&i._updateSelectionOutline(n.get())}))}function Yt(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(Xt))}})),e.on("connect.end",500,(function(e){var n=e.context.connection;n&&t.select(n)})),e.on("shape.move.end",500,(function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);u(n,(function(e){return r.id===e.id}))||t.select(r)})),e.on("element.click",(function(e){if(Bt(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=function(e){var t=Nt(e)||e;return!!Bt(e)&&(Ot()?t.metaKey:t.ctrlKey)}(e)||function(e){var t=Nt(e)||e;return Bt(e)&&t.shiftKey}(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)}}))}function Xt(e){return!e.hidden}qt.$inject=["canvas","eventBus","selection"],qt.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");H(t);var n=e.length>1;if(z(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var i=function(e){return{x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}}(Vt(e)),r=Y("rect");V(r,E({rx:3},i)),z(r).add("djs-selection-outline"),L(t,r)}},Yt.$inject=["eventBus","selection","canvas","elementRegistry"];var Zt={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Ft,Gt],selection:["type",Ht],selectionVisuals:["type",qt],selectionBehavior:["type",Yt]};function Jt(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Jt.prototype.next=function(){return this._prefix+ ++this._counter};var Qt=new Jt("ov");function en(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=Qt,this._overlayDefaults=E({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),Te(o=Ze('
'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function tn(e,t,n){Te(e,{left:t+"px",top:n+"px"})}function nn(e,t){e.style.display=!1===t?"none":""}function rn(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach((function(n){e.style[n+"transform"]=t}))}en.$inject=["config.overlays","eventBus","canvas","elementRegistry"],en.prototype.get=function(e){if(p(e)&&(e={id:e}),p(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},en.prototype.add=function(e,t,n){if(a(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=E({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},en.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&&(Qe(e.html),Qe(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)}}))},en.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},en.prototype.show=function(){nn(this._overlayRoot)},en.prototype.hide=function(){nn(this._overlayRoot,!1)},en.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Le(this._overlayRoot)},en.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=Vt(t);i=o.x,r=o.y}tn(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)},en.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,a=i.left,s=i.top;void 0!==i.right&&(t=o.waypoints?Vt(o).width:o.width,a=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?Vt(o).height:o.height,s=-1*i.bottom+n);tn(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},en.prototype._createOverlayContainer=function(e){var t=Ze('
');Te(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},en.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";rn(this._overlayRoot,n)},en.prototype._getOverlayContainer=function(e,t){var n=u(this._overlayContainers,(function(t){return t.element===e}));return n||t?n:this._createOverlayContainer(e)},en.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),p(o)&&(o=Ze(o)),n=this._getOverlayContainer(r),Te(t=Ze('
'),{position:"absolute"}),t.appendChild(o),e.type&&De(t).add("djs-overlay-"+e.type),nn(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())},en.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),o=n&&n.minZoom,a=n&&n.maxZoom,s=e.htmlContainer,l=!0;(i!==this._canvas.getRootElement()||n&&(r(o)&&o>t.scale||r(a)&&ai&&(o=(1/t.scale||1)*i)),r(o)&&(l="scale("+o+","+o+")"),rn(s,l)},en.prototype._updateOverlaysVisibilty=function(e){var t=this;f(this._overlays,(function(n){t._updateOverlayVisibilty(n,e)}))},en.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){Qe(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 on={__init__:["overlays"],overlays:["type",en]};function an(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(Wt(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)}))}an.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var sn={__init__:["changeSupport"],changeSupport:["type",an]};function ln(e){this._eventBus=e}function pn(e){return function(t,n,i,r,o){(l(t)||s(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function cn(e,t){t.invoke(ln,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)}))}ln.$inject=["eventBus"],ln.prototype.on=function(e,t,n,i,r,p){if((l(t)||s(t))&&(p=r,r=i,i=n,n=t,t=null),l(n)&&(p=r,r=i,i=n,n=1e3),a(r)&&(p=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,p):i,p)}))},ln.prototype.canExecute=pn("canExecute"),ln.prototype.preExecute=pn("preExecute"),ln.prototype.preExecuted=pn("preExecuted"),ln.prototype.execute=pn("execute"),ln.prototype.executed=pn("executed"),ln.prototype.postExecute=pn("postExecute"),ln.prototype.postExecuted=pn("postExecuted"),ln.prototype.revert=pn("revert"),ln.prototype.reverted=pn("reverted"),e(cn,ln),cn.$inject=["canvas","injector"];var un={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",cn]},hn={"&":"&","<":"<",">":">",'"':""","'":"'"};var fn="_plane";function mn(e){var t=e.id;return k(e,"bpmn:SubProcess")?function(e){return e+fn}(t):t}function dn(e,t,n){var i=Ze('
    '),r=n.getContainer(),o=De(r);r.appendChild(i);var a=[];function s(e){e&&(a=function(e){for(var t=R(e),n=[],i=t;i;i=i.$parent)(k(i,"bpmn:SubProcess")||k(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var r=a.map((function(e){var i,r=(i=""+(i=e.name||e.id))&&i.replace(/[&<>"']/g,(function(e){return hn[e]})),o=Ze('
  • '+r+"
  • "),a=n.findRoot(mn(e))||n.findRoot(e.id);if(!a&&k(e,"bpmn:Process")){var s=t.find((function(t){var n=R(t);return n&&n.get("processRef")&&n.get("processRef")===e}));a=n.findRoot(s.id)}return o.addEventListener("click",(function(){n.setRootElement(a)})),o}));i.innerHTML="";var s=r.length>1;o.toggle("bjs-breadcrumbs-shown",s),r.forEach((function(e){i.appendChild(e)}))}e.on("element.changed",(function(e){var t=R(e.element);u(a,(function(e){return e===t}))&&s()})),e.on("root.set",(function(e){s(e.element)}))}function yn(e,t){var n=null,i=new gn;e.on("root.set",(function(e){var r=e.element,o=t.viewbox(),a=i.get(r);if(i.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=r,!k(r,"bpmn:Collaboration")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,l=(o.y-a.y)*o.scale;0===s&&0===l||t.scroll({dx:s,dy:l}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}})),e.on("diagram.clear",(function(){i.clear(),n=null}))}function gn(){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)}}dn.$inject=["eventBus","elementRegistry","canvas"],yn.$inject=["eventBus","canvas"];var vn=180,xn=160;function wn(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 bn(e){return k(e,"bpmndi:BPMNDiagram")?e:bn(e.$parent)}wn.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)}))}},wn.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach((function(t){var r=t.bpmnElement;if(r){var o=r.$parent;k(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!k(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(function(e,t){return y(t,(function(t){return k(e,t)}))}(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))return!1;return!0}(r,e)&&i.push({diElement:t,parent:o})}}));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 o=t._processToDiagramMap[r.id];t._moveToDiPlane(i,o.plane)}})),r},wn.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=bt(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-vn,r=n.y-xn;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)}))},wn.prototype._moveToDiPlane=function(e,t){var n=bn(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},wn.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},wn.$inject=["eventBus","moddle"];var En=250;function _n(e,t,n,i){ln.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i;var r=this;this.executed("shape.toggleCollapse",En,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.reverted("shape.toggleCollapse",En,(function(e){var t=e.shape;r._canDrillDown(t)?r._addOverlay(t):r._removeOverlay(t)}),!0),this.executed(["shape.create","shape.move","shape.delete"],En,(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"],En,(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.render.complete",(function(){n.filter((function(e){return r._canDrillDown(e)})).map((function(e){r._addOverlay(e)}))}))}e(_n,ln),_n.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},_n.prototype._canDrillDown=function(e){var t=this._canvas;return k(e,"bpmn:SubProcess")&&t.findRoot(mn(e))},_n.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=R(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;De(i.html).toggle("bjs-drilldown-empty",!r)}},_n.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays;n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var i=Ze('');i.addEventListener("click",(function(){t.setRootElement(t.findRoot(mn(e)))})),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:i}),this._updateOverlayVisibility(e)},_n.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},_n.$inject=["canvas","eventBus","elementRegistry","overlays"];var An={__depends__:[on,sn,un],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",dn],drilldownCentering:["type",yn],drilldownOverlayBehavior:["type",_n],subprocessCompatibility:["type",wn]};const kn=/^class[ {]/;function Rn(e){return Array.isArray(e)}function Sn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Cn(...e){1===e.length&&Rn(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const Mn=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Pn=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,Nn=/\/\*([^*]*)\*\//m;function Tn(e){if("function"!=typeof e)throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(function(e){return kn.test(e.toString())}(e)?Mn:Pn);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map((e=>{const t=e.match(Nn);return(t&&t[1]||e).trim()}))||[]}function On(e,t){t=t||{get:function(e,t){if(n.push(e),!1===t)return null;throw a(`No provider for "${e}"!`)}};const n=[],i=this._providers=Object.create(t._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(e){const t=n.join(" -> ");return n.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function s(e,o){if(!i[e]&&-1!==e.indexOf(".")){const t=e.split(".");let n=s(t.shift());for(;t.length;)n=n[t.shift()];return n}if(Sn(r,e))return r[e];if(Sn(i,e)){if(-1!==n.indexOf(e))throw n.push(e),a("Cannot resolve circular dependency!");return n.push(e),r[e]=i[e][0](i[e][1]),n.pop(),r[e]}return t.get(e,o)}function l(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!Rn(e))throw a(`Cannot invoke "${e}". Expected a function!`);e=Cn(e.slice())}return{fn:e,dependencies:(e.$inject||Tn(e)).map((e=>Sn(t,e)?t[e]:s(e)))}}function p(e){const{fn:t,dependencies:n}=l(e);return new(Function.prototype.bind.apply(t,[null].concat(n)))}function c(e,t,n){const{fn:i,dependencies:r}=l(e,n);return i.apply(t,r)}function u(e){return Cn((t=>e.get(t)))}function h(e,t){if(t&&t.length){const n=Object.create(null),r=Object.create(null),o=[],a=[],s=[];let l,p,c,h;for(let e in i)l=i[e],-1!==t.indexOf(e)&&("private"===l[2]?(p=o.indexOf(l[3]),-1===p?(c=l[3].createChild([],t),h=u(c),o.push(l[3]),a.push(c),s.push(h),n[e]=[h,e,"private",c]):n[e]=[s[p],e,"private",a[p]]):n[e]=[l[2],l[1]],r[e]=!0),"factory"!==l[2]&&"type"!==l[2]||!l[1].$scope||t.forEach((t=>{-1!==l[1].$scope.indexOf(t)&&(n[e]=[l[2],l[1]],r[t]=!0)}));t.forEach((e=>{if(!r[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')})),e.unshift(n)}return new On(e,o)}const f={factory:c,type:p,value:function(e){return e}};function m(e,t){const n=e.__init__||[];return function(){n.forEach((e=>{"string"==typeof e?t.get(e):t.invoke(e)}))}}function d(e){const t=e.__exports__;if(t){const n=e.__modules__,r=Object.keys(e).reduce(((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t)),Object.create(null)),o=h((n||[]).concat(r)),a=Cn((function(e){return o.get(e)}));t.forEach((function(e){i[e]=[a,e,"private",o]}));const s=(e.__init__||[]).slice();return s.unshift((function(){o.init()})),m(e=Object.assign({},e,{__init__:s}),o)}return Object.keys(e).forEach((function(t){if("__init__"===t||"__depends__"===t)return;if("private"===e[t][2])return void(i[t]=e[t]);const n=e[t][0],r=e[t][1];i[t]=[f[n],Dn(n,r),n]})),m(e,o)}function y(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(y,e)).indexOf(t)?e:e.concat(t)}this.get=s,this.invoke=c,this.instantiate=p,this.createChild=h,this.init=function(e){const t=e.reduce(y,[]).map(d);let n=!1;return function(){n||(n=!0,t.forEach((e=>e())))}}(e)}function Dn(e,t){return"value"!==e&&Rn(t)&&(t=Cn(t.slice())),t}function Bn(e,t){A.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})}e(Bn,A),Bn.prototype.canRender=function(){return!0},Bn.prototype.drawShape=function(e,t,n){var i=Y("rect");return V(i,{x:0,y:0,width:t.width||0,height:t.height||0}),zt(t)?V(i,E({},this.FRAME_STYLE,n||{})):V(i,E({},this.SHAPE_STYLE,n||{})),L(e,i),i},Bn.prototype.drawConnection=function(e,t,n){var i=me(t.waypoints,E({},this.CONNECTION_STYLE,n||{}));return L(e,i),i},Bn.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return pe([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},Bn.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 pe(r)},Bn.$inject=["eventBus","styles"];var Ln={__init__:["defaultRenderer"],defaultRenderer:["type",Bn],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 E(this.style(t,n),{class:e})},this.style=function(t,n){o(t)||n||(n=t,t=[]);var i=m(t,(function(t,n){return E(t,e[n]||{})}),{});return n?E(i,n):i},this.computeStyle=function(e,n,i){return o(n)||(i=n,n=[]),t.style(n||[],E({},i,e||{}))}}]};function In(e,t){return Math.round(e*t)/t}function jn(e){return s(e)?e+"px":e}function Fn(e,t,n){const i=Y("g");z(i).add(t);const r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const Vn={shape:["x","y","width","height"],connection:["waypoints"]};function Wn(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 zn(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Wn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Wn.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=E({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),Te(n,{position:"relative",overflow:"hidden",width:jn(e.width),height:jn(e.height)}),t.appendChild(n),n}(e),i=this._svg=Y("svg");V(i,{width:"100%",height:"100%"}),L(n,i);const r=this._viewport=Fn(i,"viewport");e.deferUpdate&&(this._viewboxChanged=function(e,t){let n,i,r,o;function a(n){let a=Date.now(),p=n?0:o+t-a;if(p>0)return s(p);e.apply(r,i),l()}function s(e){n=setTimeout(a,e)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function p(...e){o=Date.now(),i=e,r=this,n||s(t)}return p.flush=function(){n&&a(!0),l()},p.cancel=l,p}(b(this._viewboxChanged,this),300)),t.on("diagram.init",(()=>{t.fire("canvas.init",{svg:i,viewport:r})})),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],(()=>{delete this._cachedViewbox})),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},Wn.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},Wn.prototype._clear=function(){this._elementRegistry.getAll().forEach((e=>{const t=Wt(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)})),this._planes=[],this._rootElement=null,delete this._cachedViewbox},Wn.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Wn.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let 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},Wn.prototype._getChildIndex=function(e){return m(this._layers,(function(t,n){return n.visible&&e>=n.index&&t++,t}),0)},Wn.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:Fn(this._viewport,"layer-"+e,n),index:t,visible:!0}},Wn.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},Wn.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=t.group;return t.visible?(G(n),t.visible=!1,n):n},Wn.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],G(t.group))},Wn.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},Wn.prototype.findRoot=function(e){if("string"==typeof e&&(e=this._elementRegistry.get(e)),!e)return;const t=this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(e))||{};return t.rootElement},Wn.prototype.getRootElements=function(){return this._planes.map((function(e){return e.rootElement}))},Wn.prototype._findPlaneForRoot=function(e){return u(this._planes,(function(t){return t.rootElement===e}))},Wn.prototype.getContainer=function(){return this._container},Wn.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),i=this._elementRegistry._elements[e.id],i&&(f([i.gfx,i.secondaryGfx],(function(e){e&&(n?z(e).add(t):z(e).remove(t))})),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},Wn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Wn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Wn.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));return z(this.getGraphics(e)).has(t)},Wn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Wn.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},Wn.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},Wn.prototype.removeRootElement=function(e){"string"==typeof e&&(e=this._elementRegistry.get(e));if(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},Wn.prototype.setRootElement=function(e){if(e===this._rootElement)return;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},Wn.prototype._removeRoot=function(e){const t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},Wn.prototype._addRoot=function(e,t){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},Wn.prototype._setRoot=function(e,t){const 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})},Wn.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");const n=Vn[e],i=d(n,(function(e){return void 0!==t[e]}));if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},Wn.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},Wn.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);const a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},Wn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Wn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Wn.prototype._removeElement=function(e,t){const 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},Wn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Wn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Wn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Wn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Wn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Wn.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;const t=this._viewport,n=this.getSize();let i,r,o,a,s,l,p;return e?(this._changeViewbox((function(){s=Math.min(n.width/e.width,n.height/e.height);const i=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);le(t,i)})),e):(o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},a=le(t),r=a?a.matrix:function(e,t,n,i,r,o){var a=Z().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return J(a,e);case 6:return J(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),s=In(r.a,1e3),l=In(-r.e||0,1e3),p=In(-r.f||0,1e3),e=this._cachedViewbox={x:l?l/s:0,y:p?p/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n})},Wn.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox((function(){e=E({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),zn(t,n)})),{x:n.e,y:n.f}},Wn.prototype.scrollToElement=function(e,t){let n=100;"string"==typeof e&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);if(i!==this.getRootElement()&&this.setRootElement(i),i===e)return;t||(t={}),"number"==typeof t&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const r=Vt(e),o=bt(r),a=this.viewbox(),s=this.zoom();let l,p;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;const c=bt(a);if(r.width=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},Wn.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,l,p,c;l=i.getCTM();const u=l.a;return t?(a=E(o,t),s=a.matrixTransform(l.inverse()),p=r.translate(s.x,s.y).scale(1/u*e).translate(-s.x,-s.y),c=l.multiply(p)):c=r.scale(e),zn(this._viewport,c),c},Wn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Wn.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;if(e.waypoints){n=this.getGraphics(e).getBBox()}else n=e;return{x:n.x*t.scale-t.x*t.scale,y:n.y*t.scale-t.y*t.scale,width:n.width*t.scale,height:n.height*t.scale}},Wn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var $n="data-element-id";function Gn(e){this._elements={},this._eventBus=e}function Hn(e,t,n){var i=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 o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}(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 Kn(e,t){if(!(this instanceof Kn))return new Kn(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Gn.$inject=["eventBus"],Gn.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),V(t,$n,i),n&&V(n,$n,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Gn.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(V(i.gfx,$n,""),i.secondaryGfx&&V(i.secondaryGfx,$n,""),delete t[n])},Gn.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)},Gn.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&V(t,$n,i),t},Gn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&V(e,$n);var n=this._elements[t];return n&&n.element},Gn.prototype.filter=function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(n)})),t},Gn.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i in ref");t=this.props[t]}t.collection?Hn(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 o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},Kn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return function(e){return!0===e.__refs_collection}(n)||Hn(this,t,e),n},Kn.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},Kn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Kn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Un=new Kn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),qn=new Kn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Yn=new Kn({name:"attachers",collection:!0},{name:"host"}),Xn=new Kn({name:"outgoing",collection:!0},{name:"source"}),Zn=new Kn({name:"incoming",collection:!0},{name:"target"});function Jn(){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)}}),Un.bind(this,"parent"),qn.bind(this,"labels"),Xn.bind(this,"outgoing"),Zn.bind(this,"incoming")}function Qn(){Jn.call(this),Un.bind(this,"children"),Yn.bind(this,"host"),Yn.bind(this,"attachers")}function ei(){Jn.call(this),Un.bind(this,"children")}function ti(){Qn.call(this),qn.bind(this,"labelTarget")}function ni(){Jn.call(this),Xn.bind(this,"source"),Zn.bind(this,"target")}e(Qn,Jn),e(ei,Qn),e(ti,Qn),e(ni,Jn);var ii={connection:ni,shape:Qn,label:ti,root:ei};function ri(){this._uid=12}ri.prototype.createRoot=function(e){return this.create("root",e)},ri.prototype.createLabel=function(e){return this.create("label",e)},ri.prototype.createShape=function(e){return this.create("shape",e)},ri.prototype.createConnection=function(e){return this.create("connection",e)},ri.prototype.create=function(e,t){return(t=E({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=ii[e];if(!n)throw new Error("unknown type: <"+e+">");return E(new n,t)}(e,t)};var oi="__fn",ai=Array.prototype.slice;function si(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function li(){}function pi(e,t){this._eventBus=e,this._elementRegistry=t}function ci(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}si.prototype.on=function(e,t,n,i){if(e=o(e)?e:[e],l(t)&&(i=n,n=t,t=1e3),!s(t))throw new Error("priority must be a number");var r=n;i&&((r=b(n,i))[oi]=n[oi]||n);var a=this;e.forEach((function(e){a._addListener(e,{priority:t,callback:r,next:null})}))},si.prototype.once=function(e,t,n,i){var r=this;if(l(t)&&(i=n,n=t,t=1e3),!s(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o[oi]=n,this.on(e,t,o)},si.prototype.off=function(e,t){e=o(e)?e:[e];var n=this;e.forEach((function(e){n._removeListener(e,t)}))},si.prototype.createEvent=function(e){var t=new li;return t.init(e),t},si.prototype.fire=function(e,t){var n,i,r,o;if(o=ai.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 li?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},si.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},si.prototype._destroy=function(){this._listeners={}},si.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},si.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(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},si.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority or , got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Ei(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function _i(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,f(e,b(this.registerPackage,this))}function Ai(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function ki(e){this.model=e}function Ri(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Si(e){return e.replace(/^:/,"")}function Ci(e,t={}){this.properties=new ki(this),this.factory=new di(this,this.properties),this.registry=new _i(e,this.properties),this.typeCache={},this.config=t}Ei.prototype.build=function(){return function(e,t){let n={},i=Object(e);return f(t,(function(t){t in i&&(n[t]=e[t])})),n}(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Ei.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)},Ei.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=r.indexOf(e);if(-1===s)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),o[i.name]=o[i.localName]=t},Ei.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=bi(r[0],i),a=bi(r[1],o.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},Ei.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},Ei.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Ei.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},Ei.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},Ei.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},Ei.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")},Ei.prototype.hasProperty=function(e){return this.propertiesByName[e]},Ei.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(f(e.properties,b((function(n){n=E({},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)},_i.prototype.getPackage=function(e){return this.packageMap[e]},_i.prototype.getPackages=function(){return this.packages},_i.prototype.registerPackage=function(e){e=E({},e);var t=this.packageMap;Ai(t,e,"prefix"),Ai(t,e,"uri"),f(e.types,b((function(t){this.registerType(t,e)}),this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},_i.prototype.registerType=function(e,t){var n=bi((e=E({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:E(e.meta||{})})).name,t.prefix),i=n.name,r={};f(e.properties,b((function(e){var t=bi(e.name,n.prefix),i=t.name;xi(e.type)||(e.type=bi(e.type,t.prefix).name),E(e,{ns:t,name:i}),r[i]=e}),this)),E(e,{ns:n,name:i,propertiesByName:r}),f(e.extends,b((function(e){var t=bi(e,n.prefix),r=this.typeMap[t.name];r.traits=r.traits||[],r.traits.push(i)}),this)),this.definePackage(e,t),this.typeMap[i]=e},_i.prototype.mapTypes=function(e,t,n){var i=xi(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(n,i){var o=bi(n,xi(n)?"":e.prefix);r.mapTypes(o,t,i)}function a(e){return o(e,!0)}if(!i)throw new Error("unknown type <"+e.name+">");f(i.superClass,n?a:function(e){return o(e,!1)}),t(i,!n),f(i.traits,a)},_i.prototype.getEffectiveDescriptor=function(e){var t=bi(e),n=new Ei(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},_i.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},ki.prototype.set=function(e,t,n){if(!p(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[Si(t)]:i?r in e?e[r]=n:Ri(e,i,n):e.$attrs[Si(t)]=n},ki.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[Si(t)];var i=n.name;return!e[i]&&n.isMany&&Ri(e,n,[]),e[i]},ki.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=E({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},ki.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},ki.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},ki.prototype.getProperty=function(e,t){var n=this.model,i=n.getPropertyDescriptor(e,t);if(i)return i;if(t.includes(":"))return null;const r=n.config.strict;if(void 0!==r){const n=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw n;"undefined"!=typeof console&&console.warn(n)}return null},Ci.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Ci.prototype.getType=function(e){var t=this.typeCache,n=p(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Ci.prototype.createAny=function(e,t,n){var o=bi(e),s={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){!function(e,t,n){let o=e;f(t,(function(e,a){if("number"!=typeof e&&"string"!=typeof e)throw new Error("illegal key type: "+typeof e+". Key should be of type number or string.");if("constructor"===e)throw new Error("illegal key: constructor");if("__proto__"===e)throw new Error("illegal key: __proto__");let s=t[a+1],l=o[e];r(s)&&null==l&&(l=o[e]=isNaN(+s)?{}:[]),i(s)?i(n)?delete o[e]:o[e]=n:o=l}))}(this,[e],t)}},l={name:e,isGeneric:!0,ns:{prefix:o.prefix,localName:o.localName,uri:t}};return this.properties.defineDescriptor(s,l),this.properties.defineModel(s,this),this.properties.define(s,"get",{enumerable:!1,writable:!0}),this.properties.define(s,"set",{enumerable:!1,writable:!0}),this.properties.define(s,"$parent",{enumerable:!1,writable:!0}),this.properties.define(s,"$instanceOf",{enumerable:!1,writable:!0}),f(n,(function(e,t){a(e)&&void 0!==e.value?s[e.name]=e.value:s[t]=e})),s},Ci.prototype.getPackage=function(e){return this.registry.getPackage(e)},Ci.prototype.getPackages=function(){return this.registry.getPackages()},Ci.prototype.getElementDescriptor=function(e){return e.$descriptor},Ci.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Ci.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Ci.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Mi=String.fromCharCode,Pi=Object.prototype.hasOwnProperty,Ni=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,Ti={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Oi(e,t,n,i){return i?Pi.call(Ti,i)?Ti[i]:"&"+i+";":Mi(t||parseInt(n,16))}function Di(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(Ni,Oi):e}Object.keys(Ti).forEach((function(e){Ti[e.toUpperCase()]=Ti[e]}));var Bi="xsi:type",Li="non-whitespace outside of root node";function Ii(e){return new Error(e)}function ji(e){return"missing namespace for prefix <"+e+">"}function Fi(e){return{get:e,enumerable:!0}}function Vi(e){var t,n={};for(t in e)n[t]=e[t];return n}function Wi(e){return e+"$uri"}function zi(){return{line:0,column:0}}function $i(e){throw e}function Gi(e){if(!this)return new Gi(e);var t,n,i,r,o,a,s,l,p,c=e&&e.proxy,u=$i,h=zi,f=!1,m=!1,d=null,y=!1;function g(e){e instanceof Error||(e=Ii(e)),d=e,u(e,h)}function v(e){o&&(e instanceof Error||(e=Ii(e)),o(e,h))}this.on=function(e,p){if("function"!=typeof p)throw Ii("required args ");switch(e){case"openTag":n=p;break;case"text":t=p;break;case"closeTag":i=p;break;case"error":u=p;break;case"warn":o=p;break;case"cdata":r=p;break;case"attention":l=p;break;case"question":s=p;break;case"comment":a=p;break;default:throw Ii("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw Ii("required args ");var t,n={};for(t in e)n[t]=e[t];return n["http://www.w3.org/2001/XMLSchema-instance"]="xsi",m=!0,p=n,this},this.parse=function(e){if("string"!=typeof e)throw Ii("required args ");return d=null,function(e){var o,u,d,x,w,b,E,_,A,k,R,S=m?[]:null,C=m?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[Wi(n)]=t;return i}(p):null,M=[],P=0,N=!1,T=!1,O=0,D=0,B="",L=0;function I(){if(null!==R)return R;var e,t,n,i,r,o,a,s,l,c,u,h=m&&C.xmlns,d=m&&f?[]:null,y=L,g=B,x=g.length,w={},b={};e:for(;y8)){for((c<65||c>122||c>90&&c<97)&&95!==c&&58!==c&&(v("illegal first char attribute name"),l=!0),u=y+1;u96&&c<123||c>64&&c<91||c>47&&c<59||46===c||45===c||95===c)){if(32===c||c<14&&c>8){v("missing attribute value"),y=u;continue e}if(61===c)break;v("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(s=g.substring(y,u))&&(v("illegal declaration of xmlns"),l=!0),34===(c=g.charCodeAt(u+1)))-1===(u=g.indexOf('"',y=u+2))&&-1!==(u=g.indexOf("'",y))&&(v("attribute value quote missmatch"),l=!0);else if(39===c)-1===(u=g.indexOf("'",y=u+2))&&-1!==(u=g.indexOf('"',y))&&(v("attribute value quote missmatch"),l=!0);else for(v("missing attribute value quotes"),l=!0,u+=1;u8);u++);for(-1===u&&(v("missing closing quotes"),u=x,l=!0),l||(o=g.substring(y,u)),y=u;u+18);u++)y===u&&(v("illegal character after attribute end"),l=!0);if(y=u+1,!l)if(s in b)v("attribute <"+s+"> already defined");else if(b[s]=!0,m)if(f){if(null!==(r="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=Di(o),t=Wi(r),!(a=p[e])){if("xmlns"===r||t in C&&C[t]!==e)do{a="ns"+P++}while(void 0!==C[a]);else a=r;p[e]=a}C[r]!==a&&(i||(C=Vi(C),i=!0),C[r]=a,"xmlns"===r&&(C[Wi(a)]=e,h=a),C[t]=e),w[s]=o;continue}d.push(s,o)}else-1!==(c=s.indexOf(":"))?(n=C[s.substring(0,c)])?((s=h===n?s.substr(c+1):n+s.substr(c))===Bi&&(-1!==(c=o.indexOf(":"))?(n=o.substring(0,c),o=(n=C[n]||n)+o.substring(c)):o=h+":"+o),w[s]=o):v(ji(s.substring(0,c))):w[s]=o;else w[s]=o}if(f)for(y=0,x=d.length;y=a&&(t=i.exec(e))&&!((s=t[0].length+t.index)>O);)r+=1,a=s;return-1==O?(o=s,n=e.substring(D)):0===D?n=e.substring(D,O):(o=O-a,n=-1==D?e.substring(O):e.substring(O,D+1)),{data:n,line:r,column:o}}h=j,c&&(k=Object.create({},{name:Fi((function(){return _})),originalName:Fi((function(){return A})),attrs:Fi(I),ns:Fi((function(){return C}))}));for(;-1!==D;){if(-1===(O=60===e.charCodeAt(D)?D:e.indexOf("<",D)))return M.length?g("unexpected end of file"):0===D?g("missing start tag"):void(D",O)))return g("unclosed cdata");if(r&&(r(e.substring(O+9,D),h),y))return;D+=3;continue}if(45===x&&45===e.charCodeAt(O+3)){if(-1===(D=e.indexOf("--\x3e",O)))return g("unclosed comment");if(a&&(a(e.substring(O+4,D),Di,h),y))return;D+=3;continue}}if(63!==w){for(u=O+1;;u++){if(b=e.charCodeAt(u),isNaN(b))return D=-1,g("unclosed tag");if(34===b)u=-1!==(x=e.indexOf('"',u+1))?x:u;else if(39===b)u=-1!==(x=e.indexOf("'",u+1))?x:u;else if(62===b){D=u;break}}if(33!==w){if(R={},47===w){if(N=!1,T=!0,!M.length)return g("missing open tag");if(u=_=M.pop(),x=O+2+u.length,e.substring(O+2,x)!==u)return g("closing tag mismatch");for(;x8&&w<14))return g("close tag")}else{if(47===e.charCodeAt(D-1)?(u=_=e.substring(O+1,D-1),N=!0,T=!0):(u=_=e.substring(O+1,D),N=!0,T=!1),!(w>96&&w<123||w>64&&w<91||95===w||58===w))return g("illegal first char nodeName");for(x=1,d=u.length;x96&&w<123||w>64&&w<91||w>47&&w<59||45===w||95===w||46==w)){if(32===w||w<14&&w>8){_=u.substring(0,x),R=null;break}return g("invalid nodeName")}T||M.push(_)}if(m){if(o=C,N&&(T||S.push(o),null===R&&(f=-1!==u.indexOf("xmlns",x))&&(L=x,B=u,I(),f=!1)),A=_,-1!==(w=_.indexOf(":"))){if(!(E=C[_.substring(0,w)]))return g("missing namespace on <"+A+">");_=_.substr(w+1)}else E=C.xmlns;E&&(_=E+":"+_)}if(N&&(L=x,B=u,n&&(c?n(k,Di,T,h):n(_,I,Di,T,h),y)))return;if(T){if(i&&(i(c?k:_,Di,N,h),y))return;m&&(C=N?o:S.pop())}D+=1}else{if(l&&(l(e.substring(O,D+1),Di,h),y))return;D+=1}}else{if(-1===(D=e.indexOf("?>",O)))return g("unclosed question");if(s&&(s(e.substring(O,D+2),h),y))return;D+=2}}}(e),h=zi,y=!1,d},this.stop=function(){y=!0}}function Hi(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var Ki={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Ui="xsi:type";function qi(e){return e.xml&&e.xml.serialize}function Yi(e){return qi(e)===Ui}function Xi(e,t){return Hi(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Zi(e){return new Error(e)}function Ji(e){return e.$descriptor}function Qi(e){E(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw Zi("expected element");var t,n=this.elementsById,i=Ji(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 Zi("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function er(){}function tr(){}function nr(){}function ir(e,t){this.property=e,this.context=t}function rr(e,t){this.element=t,this.propertyDesc=e}function or(){}function ar(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function sr(e,t,n){ar.call(this,e,t,n)}function lr(e,t,n){this.model=e,this.context=n}function pr(e){e instanceof Ci&&(e={model:e}),E(this,{lax:!1},e)}er.prototype.handleEnd=function(){},er.prototype.handleText=function(){},er.prototype.handleNode=function(){},tr.prototype=Object.create(er.prototype),tr.prototype.handleNode=function(){return this},nr.prototype=Object.create(er.prototype),nr.prototype.handleText=function(e){this.body=(this.body||"")+e},ir.prototype=Object.create(nr.prototype),ir.prototype.handleNode=function(e){if(this.element)throw Zi("expected no sub nodes");return this.element=this.createReference(e),this},ir.prototype.handleEnd=function(){this.element.id=this.body},ir.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},rr.prototype=Object.create(nr.prototype),rr.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=vi(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},or.prototype=Object.create(nr.prototype),or.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},ar.prototype=Object.create(or.prototype),ar.prototype.addReference=function(e){this.context.addReference(e)},ar.prototype.handleText=function(e){if(!Ji(this.element).bodyProperty)throw Zi("unexpected body text <"+e+">");nr.prototype.handleText.call(this,e)},ar.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Ji(t).bodyProperty;n&&void 0!==e&&(e=vi(n.type,e),t.set(n.name,e))},ar.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=Ji(i),o=this.context,a=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){o.addReference({element:a,property:i.ns.name,id:e})})):o.addReference({element:a,property:i.ns.name,id:e}):(i?e=vi(i.type,e):"xmlns"!==n&&(t=bi(n,r.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:a,property:n,value:e})),a.set(n,e))})),a},ar.prototype.getPropertyForNode=function(e){var t,n,i=bi(e.name),r=this.type,o=this.model,a=Ji(r),s=i.name,l=a.propertiesByName[s];if(l&&!l.isAttr)return Yi(l)&&(t=e.attributes[Ui])?(t=function(e,t){var n=bi(e);return function(e,t){var n=e.name,i=e.localName,r=t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(n,t.getPackage(n.prefix))}(t,o),E({},l,{effectiveType:Ji(n=o.getType(t)).name})):l;var p=o.getPackage(i.prefix);if(p){if(t=Xi(i,p),n=o.getType(t),l=u(a.properties,(function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)})))return E({},l,{effectiveType:Ji(n).name})}else if(l=u(a.properties,(function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type})))return l;throw Zi("unrecognized element <"+i.name+">")},ar.prototype.toString=function(){return"ElementDescriptor["+Ji(this.type).name+"]"},ar.prototype.valueHandler=function(e,t){return new rr(e,t)},ar.prototype.referenceHandler=function(e){return new ir(e,this.context)},ar.prototype.handler=function(e){return"Element"===e?new lr(this.model,e,this.context):new ar(this.model,e,this.context)},ar.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,wi(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(E(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},sr.prototype=Object.create(ar.prototype),sr.prototype.createElement=function(e){var t=e.name,n=bi(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&Xi(n,o)||t;if(!r.hasType(a))throw Zi("unexpected element <"+e.originalName+">");return ar.prototype.createElement.call(this,e)},lr.prototype=Object.create(or.prototype),lr.prototype.createElement=function(e){var t=e.name,n=bi(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},lr.prototype.handleChild=function(e){var t=new lr(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},lr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},pr.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof ar?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,a=new Qi(E({},t,{rootHandler:i})),s=new Gi({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function p(e,t,n){var i=t(),r=i.line,o=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var l="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return a.addWarning({message:l,error:e}),!0;throw Zi(l)}function c(e,t){return p(e,t,!0)}i.context=a,l.push(i);var u=/^<\?xml /i,h=/ encoding="([^"]+)"/i,f=/^utf-8$/i;function m(e,t){try{l.peek().handleText(e)}catch(e){c(e,t)}}var d=r.getPackages().reduce((function(e,t){return e[t.uri]=t.prefix,e}),{"http://www.w3.org/XML/1998/namespace":"xml"});return s.ns(d).on("openTag",(function(e,t,n,i){var r=e.attrs||{},a=Object.keys(r).reduce((function(e,n){var i=t(r[n]);return e[n]=i,e}),{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){p(e,t,o)&&l.push(new tr)}}({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},i)})).on("question",(function(e){if(u.test(e)){var t=h.exec(e),n=t&&t[1];n&&!f.test(n)&&a.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}})).on("closeTag",(function(){l.pop().handleEnd()})).on("cdata",m).on("text",(function(e,t,n){!function(e,t){e.trim()&&m(e,t)}(t(e),n)})).on("error",p).on("warn",c),new Promise((function(t,n){var r;try{s.parse(e),function(){var e,t,n=a.elementsById,i=a.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],s=Ji(r).propertiesByName[t.property];if(o||a.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var l=r.get(s.name),p=l.indexOf(t);-1===p&&(p=l.length),o?l[p]=o:l.splice(p,1)}else r.set(s.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=Zi("failed to parse document as <"+i.type.$descriptor.name+">"));var l=a.warnings,p=a.references,c=a.elementsById;return r?(r.warnings=l,n(r)):t({rootElement:o,elementsById:c,references:p,warnings:l})}))},pr.prototype.handler=function(e){return new sr(this.model,e)};var cr=/<|>|'|"|&|\n\r|\n/g,ur=/<|>|&/g;function hr(e){var t={},n={},i={},r=[],o=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.push(e):o.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,o).filter((function(e){var n=t.getNSKey(e);return i[n]}))}}function fr(e,t){return Hi(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function mr(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function dr(e){return p(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var yr={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},gr={"<":"lt",">":"gt","&":"amp"};function vr(e,t,n){return(e=p(e)?e:""+e).replace(t,(function(e){return"&"+n[e]+";"}))}function xr(e){this.tagName=e}function wr(){}function br(e){this.tagName=e}function Er(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function _r(e,t){Er.call(this,e,t)}function Ar(){this.value="",this.write=function(e){this.value+=e}}function kr(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=E({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new Ar,r=new kr(i,e.format);if(e.preamble&&r.append('\n'),(new Er).build(t).serializeTo(r),!n)return i.value}}}function Sr(e,t){Ci.call(this,e,t)}xr.prototype.build=function(e){return this.element=e,this},xr.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()},wr.prototype.serializeValue=wr.prototype.serializeTo=function(e){e.append(this.escape?vr(this.value,ur,gr):this.value)},wr.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(ur)&&(this.escape=!0),this},mr(br,wr),br.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()},Er.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(e){return h(e.$descriptor.properties,(function(t){var n=t.name;if(t.isVirtual)return!1;if(!c(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?E({localName:t.ns.localName},e):E({localName:fr(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},Er.prototype.nsPropertyTagName=function(e){return function(e,t){return E({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=p(e)?bi(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}:E({localName:t.localName},n)},Er.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return f(e,(function(r,o){"$body"===o?n.push((new wr).build({type:"String"},r)):"$children"===o?f(r,(function(e){n.push(new Er(t).build(e))})):0!==o.indexOf("$")&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})})),i},Er.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=bi(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},Er.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return f(i,(function(t,i){var o=n.parseNsAttribute(e,i,t);o&&r.push(o)})),r},Er.prototype.parseGenericAttributes=function(e,t){var n=this;f(t,(function(t){if(t.name!==Ui)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),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new wr).build(e,r[0]));else if(wi(e.type))f(r,(function(i){n.push(new br(t.addTagName(t.nsPropertyTagName(e))).build(e,i))}));else if(o)f(r,(function(i){n.push(new xr(t.addTagName(t.nsPropertyTagName(e))).build(i))}));else{var a=Yi(e),s=function(e){return"property"===qi(e)}(e);f(r,(function(i){var r;r=a?new _r(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 hr(t):n=t),n},Er.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},Er.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,a=this.getNamespaces(t),s=e.prefix,l=e.uri;if(!s&&!l)return{localName:e.localName};if(r=Ki[s]||o&&(o.getPackage(s)||{}).uri,!(l=l||r||a.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=a.byUri(l))){for(n=s,i=1;a.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:l},r===l)}return s&&a.mapPrefix(s,l),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),dr(e)},Er.prototype.addAttribute=function(e,t){var n=this.attrs;p(t)&&(t=vr(t,cr,yr));var i=function(e,t){const n=v(t);let i=o(e)?-1:void 0;return f(e,(function(e,t){if(n(e,t))return i=t,!1})),i}(n,(function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix})),r={name:e,value:t};-1!==i?n.splice(i,1,r):n.push(r)},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(dr(t.name)).append('="').append(t.value).append('"')}))},Er.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==wr;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("")),e.appendNewLine()},mr(_r,Er),_r.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),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(Ui),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},_r.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Sr.prototype=Object.create(Ci.prototype),Sr.prototype.fromXML=function(e,t,n){p(t)||(n=t,t="bpmn:Definitions");var i=new pr(E({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},Sr.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 Cr={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",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 Mr(e,t){return new Sr(E({},Cr,e),t)}var Pr="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";function Nr(e,t){return e.$instanceOf(t)}function Tr(e,t){var n={},i=[],r={};function o(e,t){return function(n){e(n,t)}}function a(e){n[e.id]=e}function s(n,i){try{var o=r[n.id]&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:kt(n)}));return e.element(n,r[n.id],i)}(n,i);return a(n),o}catch(e){l(e.message,{element:n,error:e}),console.error(t("failed to import {element}",{element:kt(n)})),console.error(e)}}function l(t,n){e.error(t,n)}var p=this.registerDi=function(e){var n,i=e.bpmnElement;i?r[i.id]?l(t("multiple DI elements defined for {element}",{element:kt(i)}),{element:i}):(r[i.id]=e,c(n=i,"di")||Object.defineProperty(n,"di",{enumerable:!1,get:function(){throw new Error(Pr)}})):l(t("no bpmnElement referenced in {element}",{element:kt(e)}),{element:e})};function m(e){var t;t=e.plane,p(t),f(t.planeElement,d)}function d(e){p(e)}this.handleDefinitions=function(a,s){var c=a.diagrams;if(s&&-1===c.indexOf(s))throw new Error(t("diagram not part of bpmn:Definitions"));if(!s&&c&&c.length&&(s=c[0]),!s)throw new Error(t("no diagram to display"));r={},m(s);var d=s.plane;if(!d)throw new Error(t("no plane for {element}",{element:kt(s)}));var x=d.bpmnElement;if(!x){if(x=function(e){return u(e.rootElements,(function(e){return Nr(e,"bpmn:Process")||Nr(e,"bpmn:Collaboration")}))}(a),!x)throw new Error(t("no process or collaboration to display"));l(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:kt(d),rootElement:kt(x)})),d.bpmnElement=x,p(d)}var w,b,E=function(t,n){return e.root(t,r[t.id],n)}(x,d);if(Nr(x,"bpmn:Process")||Nr(x,"bpmn:SubProcess"))g(x,E);else{if(!Nr(x,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:kt(d),rootElement:kt(x)}));b=E,f((w=x).participants,o(N,b)),_(w.artifacts,b),i.push((function(){!function(e,t){f(e,o(v,t))}(w.messageFlows,b)})),function(e,t){var i=h(e,(function(e){return!n[e.id]&&Nr(e,"bpmn:Process")&&e.laneSets}));i.forEach(o(g,t))}(a.rootElements,E)}y(i)};var y=this.handleDeferred=function(){for(;i.length;)i.shift()()};function g(e,t){P(e,t),A(e.ioSpecification,t),_(e.artifacts,t),a(e)}function v(e,t){s(e,t)}function x(e,t){s(e,t)}function w(e,t){s(e,t)}function b(e,t){s(e,t)}function E(e,t){s(e,t)}function _(e,t){f(e,(function(e){Nr(e,"bpmn:Association")?i.push((function(){E(e,t)})):E(e,t)}))}function A(e,t){e&&(f(e.dataInputs,o(w,t)),f(e.dataOutputs,o(b,t)))}var k=this.handleSubProcess=function(e,t){P(e,t),_(e.artifacts,t)};function R(e,t){var n=s(e,t);Nr(e,"bpmn:SubProcess")&&k(e,n||t),Nr(e,"bpmn:Activity")&&A(e.ioSpecification,t),i.push((function(){f(e.dataInputAssociations,o(x,t)),f(e.dataOutputAssociations,o(x,t))}))}function S(e,t){s(e,t)}function C(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,o(C,t))}function P(e,n){!function(e,n){f(e,(function(e){Nr(e,"bpmn:SequenceFlow")?i.push((function(){!function(e,t){s(e,t)}(e,n)})):Nr(e,"bpmn:BoundaryEvent")?i.unshift((function(){R(e,n)})):Nr(e,"bpmn:FlowNode")?R(e,n):Nr(e,"bpmn:DataObject")||(Nr(e,"bpmn:DataStoreReference")||Nr(e,"bpmn:DataObjectReference")?S(e,n):l(t("unrecognized flowElement {element} in context {context}",{element:kt(e),context:n?kt(n.businessObject):"null"}),{element:e,context:n}))}))}(e.flowElements,n),e.laneSets&&function(e,t){f(e,o(M,t))}(e.laneSets,n)}function N(e,t){var n=s(e,t),i=e.processRef;i&&g(i,n||t)}}function Or(e,t,n){var i,r,o,a,s=[];function l(e,t){var n=new Tr({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})}},o);t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t)return;var n,i=t.plane.bpmnElement,r=i;k(i,"bpmn:Process")||k(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(k(t,"bpmn:Process"))return t;t=t.$parent}} /** - * This file contains source code adapted from Snap.svg (licensed Apache-2.0). - * - * @see https://github.com/adobe-webplatform/Snap.svg/blob/master/src/path.js - */Math.PI;function ct(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 ut(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':""}function ht(e,t){return b({id:e.id,type:e.$type,businessObject:e},t)}function mt(e,t,n){var i=e.di.waypoint;return!i||i.length<2?[ct(t),ct(n)]:i.map(function(e){return{x:e.x,y:e.y}})}function ft(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:ut(n),referenced:ut(t),property:i}))}function dt(e,t,n,i,r,a){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=a}dt.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],dt.prototype.add=function(e,t){var n,i,r,a,o,s,l,p=e.di,c=this._translate;if(_(p,"bpmndi:BPMNPlane"))n=this._elementFactory.createRoot(ht(e)),this._canvas.setRootElement(n);else if(_(p,"bpmndi:BPMNShape")){var u=!S(e),h=function(e){return _(e,"bpmn:Group")}(e);i=t&&(t.hidden||t.collapsed);var m=e.di.bounds;n=this._elementFactory.createShape(ht(e,{collapsed:u,hidden:i,x:Math.round(m.x),y:Math.round(m.y),width:Math.round(m.width),height:Math.round(m.height),isFrame:h})),_(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,n),_(e,"bpmn:Lane")&&(r=0),_(e,"bpmn:DataStoreReference")&&(a=t,o=ct(m),s=o.x,l=o.y,s>=a.x&&s<=a.x+a.width&&l>=a.y&&l<=a.y+a.height||(t=this._canvas.getRootElement())),this._canvas.addShape(n,t,r)}else{if(!_(p,"bpmndi:BPMNEdge"))throw new Error(c("unknown di {di} for element {semantic}",{di:ut(p),semantic:ut(e)}));var f=this._getSource(e),d=this._getTarget(e);i=t&&(t.hidden||t.collapsed),n=this._elementFactory.createConnection(ht(e,{hidden:i,source:f,target:d,waypoints:mt(e,f,d)})),_(e,"bpmn:DataAssociation")&&(t=null),_(e,"bpmn:SequenceFlow")&&(r=0),this._canvas.addConnection(n,t,r)}return function(e){return _(e,"bpmn:Event")||_(e,"bpmn:Gateway")||_(e,"bpmn:DataStoreReference")||_(e,"bpmn:DataObjectReference")||_(e,"bpmn:DataInput")||_(e,"bpmn:DataOutput")||_(e,"bpmn:SequenceFlow")||_(e,"bpmn:MessageFlow")||_(e,"bpmn:Group")}(e)&&R(n)&&this.addLabel(e,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},dt.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:ut(e)}));var r=this._elementRegistry.get(i.id),a=r&&r.attachers;if(!r)throw ft(n,e,i,"attachedToRef");t.host=r,a||(r.attachers=a=[]),-1===a.indexOf(t)&&a.push(t)},dt.prototype.addLabel=function(e,t){var n,i,r;return n=pt(e,t),(i=R(t))&&(n=this._textRenderer.getExternalLabelBounds(n,i)),r=this._elementFactory.createLabel(ht(e,{id:e.id+"_label",labelTarget:t,type:"label",hidden:t.hidden||!R(t),x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(r,t.parent)},dt.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?ft(a,e,i,t+"Ref"):new Error(a("{semantic}#{side} Ref not specified",{semantic:ut(e),side:t}))},dt.prototype._getSource=function(e){return this._getEnd(e,"source")},dt.prototype._getTarget=function(e){return this._getEnd(e,"target")},dt.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var yt={__depends__:[rt,{__depends__:[at],bpmnImporter:["type",dt]}]};function gt(e){return e.originalEvent||e.srcEvent}function vt(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 xt(e){return!(gt(e)||e).button}function bt(e){var t=gt(e)||e;return!!xt(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function Et(e){return!0}var wt=500;function _t(e,t,n){var i=this;function r(n,i,r){var a,o;(function(e,t){return!(l[e]||xt)(t)})(n,i)||(r?o=t.getGraphics(r):(a=i.delegateTarget||i.target)&&(o=a,r=t.get(o)),o&&r&&!1===e.fire(n,{element:r,gfx:o,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var a={};function o(e){return a[e]}var s={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":Et};var p="svg, .djs-element";function c(e,t,n,i){var o=a[n]=function(e){r(n,e)};i&&(l[n]=i),o.$delegate=Pe.bind(e,p,t,o)}function u(e,t,n){var i=o(n);i&&Pe.unbind(e,t,i.$delegate)}e.on("canvas.destroy",function(e){var t;t=e.svg,h(s,function(e,n){u(t,n,e)})}),e.on("canvas.init",function(e){var t;t=e.svg,h(s,function(e,n){c(t,n,e)})}),e.on(["shape.added","connection.added"],function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:i})}),e.on(["shape.changed","connection.changed"],wt,function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:i})}),e.on("interactionEvents.createHit",wt,function(e){var t=e.element,n=e.gfx;i.createDefaultHit(t,n)}),e.on("interactionEvents.updateHit",function(e){var t=e.element,n=e.gfx;i.updateDefaultHit(t,n)});var m=y("djs-hit djs-hit-stroke"),f=y("djs-hit djs-hit-click-stroke"),d={all:y("djs-hit djs-hit-all"),"click-stroke":f,stroke:m};function y(e,t){return t=b({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function g(e,t){var n=d[t];if(!n)throw new Error("invalid hit type <"+t+">");return T(e,n),e}function v(e,t){k(e,t)}this.removeHits=function(e){var t;h((t=".djs-hit",(e||document).querySelectorAll(t)),j)},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=re(t);return g(n,"stroke"),v(e,n),n},this.createBoxHit=function(e,t,n){n=b({x:0,y:0},n);var i=G("rect");return g(i,t),T(i,n),v(e,i),i},this.updateDefaultHit=function(e,t){var n=Oe(".djs-hit",t);if(n)return e.waypoints?function(e,t){T(e,{points:ie(t)})}(n,e.waypoints):T(n,{width:e.width,height:e.height}),n},this.fire=r,this.triggerMouseEvent=function(e,t,n){var i=s[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return r(i,t,n)},this.mouseHandler=o,this.registerEvent=c,this.unregisterEvent=u}_t.$inject=["eventBus","elementRegistry","styles"];var At={__init__:["interactionEvents"],interactionEvents:["type",_t]};function St(e,t){var n,i,a,o;return t=!!t,r(e)||(e=[e]),h(e,function(e){var r=e;e.waypoints&&!t&&(r=St(e.waypoints,!0));var s=r.x,l=r.y,p=r.height||0,c=r.width||0;(sa||void 0===a)&&(a=s+c),(l+p>o||void 0===o)&&(o=l+p)}),{x:n,y:i,height:o-i,width:a-n}}function Rt(e){return!(!e||!e.isFrame)}var Ct=500;function kt(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),r=this;function a(e,t){var n=G("rect");return T(n,b({x:10,y:10,width:100,height:100},i)),k(e,n),n}e.on(["shape.added","shape.changed"],Ct,function(e){var t=e.element,n=e.gfx,i=Oe(".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=Oe(".djs-outline",n);i||(i=a(n)),r.updateConnectionOutline(i,t)})}kt.prototype.updateShapeOutline=function(e,t){T(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},kt.prototype.updateConnectionOutline=function(e,t){var n=St(t);T(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},kt.$inject=["eventBus","styles","elementRegistry"];var Mt={__init__:["outline"],outline:["type",kt]};function Pt(e){this._eventBus=e,this._selectedElements=[];var t=this;e.on(["shape.remove","connection.remove"],function(e){var n=e.element;t.deselect(n)}),e.on(["diagram.clear"],function(e){t.select(null)})}Pt.$inject=["eventBus"],Pt.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})}},Pt.prototype.get=function(){return this._selectedElements},Pt.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Pt.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();r(e)||(e=e?[e]:[]),t?h(e,function(e){-1===n.indexOf(e)&&n.push(e)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Nt="hover",Tt="selected";function Dt(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,Nt)}),e.on("element.out",function(e){a(e.element,Nt)}),e.on("selection.changed",function(e){var t=e.oldSelection,n=e.newSelection;h(t,function(e){-1===n.indexOf(e)&&a(e,Tt)}),h(n,function(e){-1===t.indexOf(e)&&r(e,Tt)})})}function Ot(e,t,n,i){e.on("create.end",500,function(e){var n=e.context,i=n.canExecute,a=n.elements,o=(n.hints||{}).autoSelect;if(i){if(!1===o)return;r(o)?t.select(o):t.select(a.filter(Bt))}}),e.on("connect.end",500,function(e){e.context.canExecute&&e.context.hover&&t.select(e.context.hover)}),e.on("shape.move.end",500,function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);c(n,function(e){return r.id===e.id})||t.select(r)}),e.on("element.click",function(e){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),a=t.get().length>1,o=bt(e);if(r&&a)return o?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,o)})}function Bt(e){return!e.hidden}Dt.$inject=["eventBus","canvas","selection","styles"],Ot.$inject=["eventBus","selection","canvas","elementRegistry"];var Lt={__init__:["selectionVisuals","selectionBehavior"],__depends__:[At,Mt],selection:["type",Pt],selectionVisuals:["type",Dt],selectionBehavior:["type",Ot]};function It(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}It.prototype.next=function(){return this._prefix+ ++this._counter};var Ft=new It("ov");function jt(e,t,n,i){var r,a;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=Ft,this._overlayDefaults=b({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),a=Ne('
    '),r.insertBefore(a,r.firstChild),a),this._init()}function Vt(e,t,n){b(e.style,{left:t+"px",top:n+"px"})}function Wt(e,t){e.style.display=!1===t?"none":""}function zt(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}jt.$inject=["config.overlays","eventBus","canvas","elementRegistry"],jt.prototype.get=function(e){if(l(e)&&(e={id:e}),l(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?u(t.overlays,d({type:e.type})):t.overlays.slice():[]}return e.type?u(this._overlays,d({type:e.type})):e.id?this._overlays[e.id]:null},jt.prototype.add=function(e,t,n){if(a(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=b({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},jt.prototype.remove=function(e){var t=this.get(e)||[];r(t)||(t=[t]);var n=this;h(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Be(e.html),Be(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)}})},jt.prototype.show=function(){Wt(this._overlayRoot)},jt.prototype.hide=function(){Wt(this._overlayRoot,!1)},jt.prototype.clear=function(){this._overlays={},this._overlayContainers=[],ye(this._overlayRoot)},jt.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var a=St(t);i=a.x,r=a.y}Vt(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)},jt.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?St(a).width:a.width,o=-1*i.right+t);void 0!==i.bottom&&(n=a.waypoints?St(a).height:a.height,s=-1*i.bottom+n);Vt(r,o||0,s||0)},jt.prototype._createOverlayContainer=function(e){var t=Ne('
    ');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},jt.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";zt(this._overlayRoot,n)},jt.prototype._getOverlayContainer=function(e,t){var n=c(this._overlayContainers,function(t){return t.element===e});return n||t?n:this._createOverlayContainer(e)},jt.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,a=e.html;a.get&&a.constructor.prototype.jquery&&(a=a.get(0)),l(a)&&(a=Ne(a)),n=this._getOverlayContainer(r),(t=Ne('
    ')).appendChild(a),e.type&&fe(t).add("djs-overlay-"+e.type),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},jt.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=n&&n.minZoom,a=n&&n.maxZoom,o=e.htmlContainer,s=!0;n&&((i(r)&&r>t.scale||i(a)&&ar&&(a=(1/t.scale||1)*r)),i(a)&&(l="scale("+a+","+a+")"),zt(s,l)},jt.prototype._updateOverlaysVisibilty=function(e){var t=this;h(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},jt.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",function(e){t.hide()}),e.on("canvas.viewbox.changed",function(e){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()}),e.on(["shape.remove","connection.remove"],function(e){var n=e.element;h(t.get({element:n}),function(e){t.remove(e.id)});var i=t._getOverlayContainer(n);if(i){Be(i.html);var r=t._overlayContainers.indexOf(i);-1!==r&&t._overlayContainers.splice(r,1)}}),e.on("element.changed",500,function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(h(i.overlays,function(e){t._updateOverlay(e)}),t._updateOverlayContainer(i))}),e.on("element.marker.update",function(e){var n=t._getOverlayContainer(e.element,!0);n&&fe(n.html)[e.add?"add":"remove"](e.marker)}),e.on("diagram.clear",this.clear,this)};var Gt={__init__:["overlays"],overlays:["type",jt]},Ht=/^class /;function $t(e){return"[object Array]"===Object.prototype.toString.call(e)}function Kt(){var e=Array.prototype.slice.call(arguments);1===e.length&&$t(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var Ut=/constructor\s*[^(]*\(\s*([^)]*)\)/m,qt=/^function\s*[^(]*\(\s*([^)]*)\)/m,Yt=/\/\*([^*]*)\*\//m;function Xt(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(function(e){return Ht.test(e.toString())}(e)?Ut:qt);return t&&t[1]&&t[1].split(",").map(function(e){return(t=e.match(Yt))?t[1].trim():e.trim()})||[]}var Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Jt(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t ");return n.length=0,new Error(t?e+" (Resolving: "+t+")":e)},s=function e(a,s){if(!i[a]&&-1!==a.indexOf(".")){for(var l=a.split("."),p=e(l.shift());l.length;)p=p[l.shift()];return p}if(en(r,a))return r[a];if(en(i,a)){if(-1!==n.indexOf(a))throw n.push(a),o("Cannot resolve circular dependency!");return n.push(a),r[a]=i[a][0](i[a][1]),n.pop(),r[a]}return t.get(a,s)},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof e){if(!$t(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=Kt(e.slice())}var n=e.$inject||Xt(e),i=n.map(function(e){return en(t,e)?t[e]:s(e)});return{fn:e,dependencies:i}},p=function(e){var t=l(e),n=t.dependencies,i=t.fn;return new(Function.prototype.bind.apply(i,[null].concat(Jt(n))))},c=function(e,t,n){var i=l(e,n),r=i.dependencies,a=i.fn;return a.call.apply(a,[t].concat(Jt(r)))},u=function(e){return Kt(function(t){return e.get(t)})},h={factory:c,type:p,value:function(e){return e}};e.forEach(function(e){function t(e,t){return"value"!==e&&$t(t)&&(t=Kt(t.slice())),t}if(e instanceof function(){var e=[];this.factory=function(t,n){return e.push([t,"factory",n]),this},this.value=function(t,n){return e.push([t,"value",n]),this},this.type=function(t,n){return e.push([t,"type",n]),this},this.forEach=function(t){e.forEach(t)}})e.forEach(function(e){var n=e[0],r=e[1],a=e[2];i[n]=[h[r],t(r,a),r]});else if("object"===(void 0===e?"undefined":Zt(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 Qt((e.__modules__||[]).concat([n]),a),o=Kt(function(e){return r.get(e)});e.__exports__.forEach(function(e){i[e]=[o,e,"private",r]})}else Object.keys(e).forEach(function(n){if("private"!==e[n][2]){var r=e[n][0],a=e[n][1];i[n]=[h[r],t(r,a),r]}else i[n]=e[n]})}),this.get=s,this.invoke=c,this.instantiate=p,this.createChild=function(e,t){if(t&&t.length){var n,r,o,s,l=Object.create(null),p=Object.create(null),c=[],h=[],m=[];for(var f in i)n=i[f],-1!==t.indexOf(f)&&("private"===n[2]?-1===(r=c.indexOf(n[3]))?(o=n[3].createChild([],t),s=u(o),c.push(n[3]),h.push(o),m.push(s),l[f]=[s,f,"private",o]):l[f]=[m[r],f,"private",h[r]]:l[f]=[n[2],n[1]],p[f]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach(function(e){-1!==n[1].$scope.indexOf(e)&&(l[f]=[n[2],n[1]],p[e]=!0)});t.forEach(function(e){if(!p[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),e.unshift(l)}return new Qt(e,a)}}function en(e,t){return Object.hasOwnProperty.call(e,t)}var tn=1;function nn(e,t){w.call(this,e,tn),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}e(nn,w),nn.prototype.canRender=function(){return!0},nn.prototype.drawShape=function(e,t){var n=G("rect");return T(n,{x:0,y:0,width:t.width||0,height:t.height||0}),Rt(t)?T(n,this.FRAME_STYLE):T(n,this.SHAPE_STYLE),k(e,n),n},nn.prototype.drawConnection=function(e,t){var n=re(t.waypoints,this.CONNECTION_STYLE);return k(e,n),n},nn.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return ne([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},nn.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 ne(r)},nn.$inject=["eventBus","styles"];var rn={__init__:["defaultRenderer"],defaultRenderer:["type",nn],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){return b(this.style(t,n),{class:e})},this.style=function(t,n){r(t)||n||(n=t,t=[]);var i=m(t,function(t,n){return b(t,e[n]||{})},{});return n?b(i,n):i},this.computeStyle=function(e,n,i){return r(n)||(i=n,n=[]),t.style(n||[],b({},i,e||{}))}}]};function an(e,t){return Math.round(e*t)/t}function on(e){return o(e)?e+"px":e}function sn(e,t,n){var i=G("g");I(i).add(t);var r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}var ln={shape:["x","y","width","height"],connection:["waypoints"]};function pn(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._init(e||{})}function cn(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}pn.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],pn.prototype._init=function(e){var t=this._eventBus,n=this._container=function(e){var t=(e=b({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),b(n.style,{position:"relative",overflow:"hidden",width:on(e.width),height:on(e.height)}),t.appendChild(n),n}(e),i=this._svg=G("svg");T(i,{width:"100%",height:"100%"}),k(n,i);var r=this._viewport=sn(i,"viewport");this._layers={},!1!==e.deferUpdate&&(this._viewboxChanged=function(e,t){var n,i,r,a;function o(){var o=Date.now(),l=a+t-o;if(l>0)return s(l);e.apply(r,i),n=a=i=r=void 0}function s(e){n=setTimeout(o,e)}return function(){a=Date.now();for(var e=arguments.length,o=new Array(e),l=0;l already created at index <"+t+">");return n.group},pn.prototype._createLayer=function(e,t){t||(t=0);var n=m(this._layers,function(e,n){return t>=n.index&&e++,e},0);return{group:sn(this._viewport,"layer-"+e,n),index:t}},pn.prototype.getContainer=function(){return this._container},pn.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(h([i.gfx,i.secondaryGfx],function(e){e&&(n?I(e).add(t):I(e).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},pn.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},pn.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},pn.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),I(this.getGraphics(e)).has(t)},pn.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},pn.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot",children:[]}),this._rootElement},pn.prototype.setRootElement=function(e,t){e&&this._ensureValid("root",e);var n=this._rootElement,i=this._elementRegistry,r=this._eventBus;if(n){if(!t)throw new Error("rootElement already set, need to specify override");r.fire("root.remove",{element:n}),r.fire("root.removed",{element:n}),i.remove(n)}if(e){var a=this.getDefaultLayer();r.fire("root.add",{element:e}),i.add(e,a,this._svg),r.fire("root.added",{element:e,gfx:a})}return this._rootElement=e,e},pn.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element with id "+t.id+" already exists");var n=ln[e];if(!f(n,function(e){return void 0!==t[e]}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},pn.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},pn.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},pn.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},pn.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},pn.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},pn.prototype.removeShape=function(e){return this._removeElement(e,"shape")},pn.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},pn.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},pn.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},pn.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},pn.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,r,a,o,s=this._viewport,l=this.getSize();return e?(this._changeViewbox(function(){r=Math.min(l.width/e.width,l.height/e.height);var t=this._svg.createSVGMatrix().scale(r).translate(-e.x,-e.y);te(s,t)}),e):(t=this.getDefaultLayer().getBBox(),n=(i=te(s))?i.matrix:function(e,t,n,i,r,a){var o=H.createSVGMatrix();switch(arguments.length){case 0:return o;case 1:return $(o,e);case 6:return $(o,{a:e,b:t,c:n,d:i,e:r,f:a})}}(),r=an(n.a,1e3),a=an(-n.e||0,1e3),o=an(-n.f||0,1e3),e=this._cachedViewbox={x:a?a/r:0,y:o?o/r:0,width:l.width/r,height:l.height/r,scale:r,inner:{width:t.width,height:t.height,x:t.x,y:t.y},outer:l})},pn.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=b({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),cn(t,n)}),{x:n.e,y:n.f}},pn.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)}),an(i.a,1e3)):this.viewbox(e).scale;var n,i},pn.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},pn.prototype._setZoom=function(e,t){var n,i,r,a,o=this._svg,s=this._viewport,l=o.createSVGMatrix(),p=o.createSVGPoint(),c=(i=s.getCTM()).a;return t?(n=b(p,t).matrixTransform(i.inverse()),r=l.translate(n.x,n.y).scale(1/c*e).translate(-n.x,-n.y),a=i.multiply(r)):a=l.scale(e),cn(this._viewport,a),a},pn.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},pn.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}},pn.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var un="data-element-id";function hn(e){this._elements={},this._eventBus=e}hn.$inject=["eventBus"],hn.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),T(t,un,i),n&&T(n,un,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},hn.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(T(i.gfx,un,""),i.secondaryGfx&&T(i.secondaryGfx,un,""),delete t[n])},hn.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)},hn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&T(e,un);var n=this._elements[t];return n&&n.element},hn.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},hn.prototype.getAll=function(){return this.filter(function(e){return e})},hn.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)})},hn.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},hn.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 mn={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 fn(e,t,n){var i=mn.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 dn(e,t){if(!(this instanceof dn))return new dn(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}dn.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?fn(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)},dn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return mn.isExtended(n)||fn(this,t,e),n},dn.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},dn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},dn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var yn=dn,gn=mn;yn.Collection=gn;var vn=new yn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),xn=new yn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),bn=new yn({name:"attachers",collection:!0},{name:"host"}),En=new yn({name:"outgoing",collection:!0},{name:"source"}),wn=new yn({name:"incoming",collection:!0},{name:"target"});function _n(){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)}}),vn.bind(this,"parent"),xn.bind(this,"labels"),En.bind(this,"outgoing"),wn.bind(this,"incoming")}function An(){_n.call(this),vn.bind(this,"children"),bn.bind(this,"host"),bn.bind(this,"attachers")}function Sn(){An.call(this)}function Rn(){An.call(this),xn.bind(this,"labelTarget")}function Cn(){_n.call(this),En.bind(this,"source"),wn.bind(this,"target")}e(An,_n),e(Sn,An),e(Rn,An),e(Cn,_n);var kn={connection:Cn,shape:An,label:Rn,root:Sn};function Mn(){this._uid=12}Mn.prototype.createRoot=function(e){return this.create("root",e)},Mn.prototype.createLabel=function(e){return this.create("label",e)},Mn.prototype.createShape=function(e){return this.create("shape",e)},Mn.prototype.createConnection=function(e){return this.create("connection",e)},Mn.prototype.create=function(e,t){return(t=b({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=kn[e];if(!n)throw new Error("unknown type: <"+e+">");return b(new n,t)}(e,t)};var Pn=Array.prototype.slice;function Nn(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Tn(){}function Dn(e,t){this._eventBus=e,this._elementRegistry=t}function On(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}Nn.prototype.on=function(e,t,n,i){if(e=r(e)?e:[e],s(t)&&(i=n,n=t,t=1e3),!o(t))throw new Error("priority must be a number");var a=n;i&&((a=v(n,i)).__fn=n.__fn||n);var l=this;e.forEach(function(e){l._addListener(e,{priority:t,callback:a,next:null})})},Nn.prototype.once=function(e,t,n,i){var r=this;if(s(t)&&(i=n,n=t,t=1e3),!o(t))throw new Error("priority must be a number");function a(){var t=n.apply(i,arguments);return r.off(e,a),t}a.__fn=n,this.on(e,t,a)},Nn.prototype.off=function(e,t){e=r(e)?e:[e];var n=this;e.forEach(function(e){n._removeListener(e,t)})},Nn.prototype.createEvent=function(e){var t=new Tn;return t.init(e),t},Nn.prototype.fire=function(e,t){var n,i,r,a;if(a=Pn.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 Tn?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}},Nn.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},Nn.prototype._destroy=function(){this._listeners={}},Nn.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},Nn.prototype._invokeListener=function(e,t,n){var i;try{void 0!==(i=function(e,t){return e.apply(null,t)}(n.callback,t))&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener"),console.error(e.stack),e}return i},Nn.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority=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 Qt(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 In(e,t){this.injector=t=t||function(e){return Ln([{config:["value",e=e||{}]},Bn].concat(e.modules||[]))}(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}function Fn(){}function jn(e,t){this.model=e,this.properties=t}In.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},In.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},Fn.prototype.get=function(e){return this.$model.properties.get(this,e)},Fn.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},jn.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Fn.prototype);h(e.properties,function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)}),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function a(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),h(e,v(function(e,t){this.set(t,e)},this))}return a.prototype=i,a.hasType=i.$instanceOf=this.model.hasType,n.defineModel(a,t),n.defineDescriptor(a,e),a};var Vn={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Wn={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e,10)}};function zn(e,t){var n=Wn[e];return n?n(t):t}function Gn(e){return!!Vn[e]}function Hn(e){return!!Wn[e]}function $n(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected or , got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Kn(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function Un(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,h(e,v(this.registerPackage,this))}function qn(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function Yn(e){this.model=e}function Xn(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Zn(e){this.properties=new Yn(this),this.factory=new jn(this,this.properties),this.registry=new Un(e,this.properties),this.typeCache={}}Kn.prototype.build=function(){return e=this,t=["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"],n={},i=Object(e),h(t,function(t){t in i&&(n[t]=e[t])}),n;var e,t,n,i},Kn.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)},Kn.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},Kn.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),a=$n(r[0],i),o=$n(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},Kn.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},Kn.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Kn.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},Kn.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},Kn.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")},Kn.prototype.hasProperty=function(e){return this.propertiesByName[e]},Kn.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(h(e.properties,v(function(n){n=b({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))},this)),i.push(e),n[r]=e)},Un.prototype.getPackage=function(e){return this.packageMap[e]},Un.prototype.getPackages=function(){return this.packages},Un.prototype.registerPackage=function(e){e=b({},e);var t=this.packageMap;qn(t,e,"prefix"),qn(t,e,"uri"),h(e.types,v(function(t){this.registerType(t,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Un.prototype.registerType=function(e,t){var n=$n((e=b({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:b(e.meta||{})})).name,t.prefix),i=n.name,r={};h(e.properties,v(function(e){var t=$n(e.name,n.prefix),i=t.name;Gn(e.type)||(e.type=$n(e.type,t.prefix).name),b(e,{ns:t,name:i}),r[i]=e},this)),b(e,{ns:n,name:i,propertiesByName:r}),h(e.extends,v(function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},Un.prototype.mapTypes=function(e,t,n){var i=Gn(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function a(e){return o(e,!0)}function o(n,i){var a=$n(n,Gn(n)?"":e.prefix);r.mapTypes(a,t,i)}if(!i)throw new Error("unknown type <"+e.name+">");h(i.superClass,n?a:o),t(i,!n),h(i.traits,a)},Un.prototype.getEffectiveDescriptor=function(e){var t=$n(e),n=new Kn(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},Un.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},Yn.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:Xn(e,i,n):e.$attrs[t]=n},Yn.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&&Xn(e,n,[]),e[i]},Yn.prototype.define=function(e,t,n){Object.defineProperty(e,t,n)},Yn.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Yn.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Zn.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Zn.prototype.getType=function(e){var t=this.typeCache,n=l(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Zn.prototype.createAny=function(e,t,n){var i=$n(e),r={$type:e,$instanceOf:function(e){return e===this.$type}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),h(n,function(e,t){a(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e}),r},Zn.prototype.getPackage=function(e){return this.registry.getPackage(e)},Zn.prototype.getPackages=function(){return this.registry.getPackages()},Zn.prototype.getElementDescriptor=function(e){return e.$descriptor},Zn.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Zn.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Zn.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Jn=String.fromCharCode,Qn=Object.prototype.hasOwnProperty,ei=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,ti={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function ni(e,t,n,i){return i?Qn.call(ti,i)?ti[i]:"&"+i+";":Jn(t||parseInt(n,16))}function ii(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(ei,ni):e}Object.keys(ti).forEach(function(e){ti[e.toUpperCase()]=ti[e]});var ri="http://www.w3.org/2001/XMLSchema-instance",ai="xsi",oi="xsi:type",si="non-whitespace outside of root node";function li(e){return new Error(e)}function pi(e){return"missing namespace for prefix <"+e+">"}function ci(e){return{get:e,enumerable:!0}}function ui(e){var t,n={};for(t in e)n[t]=e[t];return n}function hi(e){return e+"$uri"}function mi(){return{line:0,column:0}}function fi(e){throw e}function di(e){if(!this)return new di(e);var t,n,i,r,a,o,s,l,p,c=e&&e.proxy,u=fi,h=mi,m=!1,f=!1,d=null,y=!1;function g(e){e instanceof Error||(e=li(e)),d=e,u(e,h)}function v(e){a&&(e instanceof Error||(e=li(e)),a(e,h))}this.on=function(e,p){if("function"!=typeof p)throw li("required args ");switch(e){case"openTag":n=p;break;case"text":t=p;break;case"closeTag":i=p;break;case"error":u=p;break;case"warn":a=p;break;case"cdata":r=p;break;case"attention":l=p;break;case"question":s=p;break;case"comment":o=p;break;default:throw li("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw li("required args ");var t,n={};for(t in e)n[t]=e[t];return n[ri]=ai,f=!0,p=n,this},this.parse=function(e){if("string"!=typeof e)throw li("required args ");return d=null,function(e){var a,u,d,x,b,E,w,_,A,S,R,C=f?[]:null,k=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[hi(n)]=t;return i}(p):null,M=[],P=0,N=!1,T=!1,D=0,O=0,B="",L=0;function I(){if(null!==R)return R;var e,t,n,i,r,a,o,s,l,c,u,h=f&&k.xmlns,d=f&&m?[]:null,y=L,g=B,x=g.length,b={},E={};e:for(;y8)){for((c<65||c>122||c>90&&c<97)&&95!==c&&58!==c&&(v("illegal first char attribute name"),l=!0),u=y+1;u96&&c<123||c>64&&c<91||c>47&&c<59||46===c||45===c||95===c)){if(32===c||c<14&&c>8){v("missing attribute value"),y=u;continue e}if(61===c)break;v("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(s=g.substring(y,u))&&(v("illegal declaration of xmlns"),l=!0),34===(c=g.charCodeAt(u+1)))-1===(u=g.indexOf('"',y=u+2))&&-1!==(u=g.indexOf("'",y))&&(v("attribute value quote missmatch"),l=!0);else if(39===c)-1===(u=g.indexOf("'",y=u+2))&&-1!==(u=g.indexOf('"',y))&&(v("attribute value quote missmatch"),l=!0);else for(v("missing attribute value quotes"),l=!0,u+=1;u8);u++);for(-1===u&&(v("missing closing quotes"),u=x,l=!0),l||(a=g.substring(y,u)),y=u;u+18);u++)y===u&&(v("illegal character after attribute end"),l=!0);if(y=u+1,!l)if(s in E)v("attribute <"+s+"> already defined");else if(E[s]=!0,f)if(m){if(null!==(r="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=ii(a),t=hi(r),!(o=p[e])){if("xmlns"===r||t in k&&k[t]!==e)do{o="ns"+P++}while(void 0!==k[o]);else o=r;p[e]=o}k[r]!==o&&(i||(k=ui(k),i=!0),k[r]=o,"xmlns"===r&&(k[hi(o)]=e,h=o),k[t]=e),b[s]=a;continue}d.push(s,a)}else-1!==(c=s.indexOf(":"))?(n=k[s.substring(0,c)])?((s=h===n?s.substr(c+1):n+s.substr(c))===oi&&(-1!==(c=a.indexOf(":"))?(n=a.substring(0,c),n=k[n]||n,a=n+a.substring(c)):a=h+":"+a),b[s]=a):v(pi(s.substring(0,c))):b[s]=a;else b[s]=a}if(m)for(y=0,x=d.length;y=o&&(t=i.exec(e))&&!((s=t[0].length+t.index)>D);)r+=1,o=s;return-1==D?(a=s,n=e.substring(O)):0===O?n=e.substring(O,D):(a=D-o,n=-1==O?e.substring(D):e.substring(D,O+1)),{data:n,line:r,column:a}},c&&(S=Object.create({},{name:ci(function(){return _}),originalName:ci(function(){return A}),attrs:ci(I),ns:ci(function(){return k})}));for(;-1!==O;){if(-1===(D=60===e.charCodeAt(O)?O:e.indexOf("<",O)))return M.length?g("unexpected end of file"):0===O?g("missing start tag"):void(O",D)))return g("unclosed cdata");if(r&&(r(e.substring(D+9,O),h),y))return;O+=3;continue}if(45===x&&45===e.charCodeAt(D+3)){if(-1===(O=e.indexOf("--\x3e",D)))return g("unclosed comment");if(o&&(o(e.substring(D+4,O),ii,h),y))return;O+=3;continue}}if(63!==b){for(u=D+1;;u++){if(E=e.charCodeAt(u),isNaN(E))return O=-1,g("unclosed tag");if(34===E)x=e.indexOf('"',u+1),u=-1!==x?x:u;else if(39===E)x=e.indexOf("'",u+1),u=-1!==x?x:u;else if(62===E){O=u;break}}if(33!==b){if(R={},47===b){if(N=!1,T=!0,!M.length)return g("missing open tag");if(u=_=M.pop(),x=D+2+u.length,e.substring(D+2,x)!==u)return g("closing tag mismatch");for(;x8&&b<14))return g("close tag")}else{if(47===e.charCodeAt(O-1)?(u=_=e.substring(D+1,O-1),N=!0,T=!0):(u=_=e.substring(D+1,O),N=!0,T=!1),!(b>96&&b<123||b>64&&b<91||95===b||58===b))return g("illegal first char nodeName");for(x=1,d=u.length;x96&&b<123||b>64&&b<91||b>47&&b<59||45===b||95===b||46==b)){if(32===b||b<14&&b>8){_=u.substring(0,x),R=null;break}return g("invalid nodeName")}T||M.push(_)}if(f){if(a=k,N&&(T||C.push(a),null===R&&(m=-1!==u.indexOf("xmlns",x))&&(L=x,B=u,I(),m=!1)),A=_,-1!==(b=_.indexOf(":"))){if(!(w=k[_.substring(0,b)]))return g("missing namespace on <"+A+">");_=_.substr(b+1)}else w=k.xmlns;w&&(_=w+":"+_)}if(N&&(L=x,B=u,n&&(c?n(S,ii,T,h):n(_,I,ii,T,h),y)))return;if(T){if(i&&(i(c?S:_,ii,N,h),y))return;f&&(k=N?a:C.pop())}O+=1}else{if(l&&(l(e.substring(D,O+1),ii,h),y))return;O+=1}}else{if(-1===(O=e.indexOf("?>",D)))return g("unclosed question");if(s&&(s(e.substring(D,O+2),h),y))return;O+=2}}}(e),h=mi,y=!1,d},this.stop=function(){y=!0}}function yi(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var gi={xsi:"http://www.w3.org/2001/XMLSchema-instance"},vi="xsi:type";function xi(e){return e.xml&&e.xml.serialize}function bi(e){return xi(e)===vi}function Ei(e,t){return yi(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function wi(e){return new Error(e)}function _i(e){return e.$descriptor}function Ai(e){b(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw wi("expected element");var t,n=this.elementsById,i=_i(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 wi("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Si(){}function Ri(){}function Ci(){}function ki(e,t){this.property=e,this.context=t}function Mi(e,t){this.element=t,this.propertyDesc=e}function Pi(){}function Ni(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Ti(e,t,n){Ni.call(this,e,t,n)}function Di(e,t,n){this.model=e,this.context=n}function Oi(e){e instanceof Zn&&(e={model:e}),b(this,{lax:!1},e)}Si.prototype.handleEnd=function(){},Si.prototype.handleText=function(){},Si.prototype.handleNode=function(){},Ri.prototype=Object.create(Si.prototype),Ri.prototype.handleNode=function(){return this},Ci.prototype=Object.create(Si.prototype),Ci.prototype.handleText=function(e){this.body=(this.body||"")+e},ki.prototype=Object.create(Ci.prototype),ki.prototype.handleNode=function(e){if(this.element)throw wi("expected no sub nodes");return this.element=this.createReference(e),this},ki.prototype.handleEnd=function(){this.element.id=this.body},ki.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Mi.prototype=Object.create(Ci.prototype),Mi.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)},Pi.prototype=Object.create(Ci.prototype),Pi.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},Ni.prototype=Object.create(Pi.prototype),Ni.prototype.addReference=function(e){this.context.addReference(e)},Ni.prototype.handleText=function(e){if(!_i(this.element).bodyProperty)throw wi("unexpected body text <"+e+">");Ci.prototype.handleText.call(this,e)},Ni.prototype.handleEnd=function(){var e=this.body,t=this.element,n=_i(t).bodyProperty;n&&void 0!==e&&(e=zn(n.type,e),t.set(n.name,e))},Ni.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=_i(i),a=this.context,o=new i({}),s=this.model;return h(n,function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?h(e.split(" "),function(e){a.addReference({element:o,property:i.ns.name,id:e})}):a.addReference({element:o,property:i.ns.name,id:e}):(i?e=zn(i.type,e):"xmlns"!==n&&(t=$n(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},Ni.prototype.getPropertyForNode=function(e){var t,n,i=$n(e.name),r=this.type,a=this.model,o=_i(r),s=i.name,l=o.propertiesByName[s];if(l&&!l.isAttr)return bi(l)&&(t=e.attributes[vi])?(t=function(e,t){var n=$n(e);return function(e,t){var n=e.name,i=e.localName,r=t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(n,t.getPackage(n.prefix))}(t,a),b({},l,{effectiveType:_i(n=a.getType(t)).name})):l;var p=a.getPackage(i.prefix);if(p){if(t=Ei(i,p),n=a.getType(t),l=c(o.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return b({},l,{effectiveType:_i(n).name})}else if(l=c(o.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return l;throw wi("unrecognized element <"+i.name+">")},Ni.prototype.toString=function(){return"ElementDescriptor["+_i(this.type).name+"]"},Ni.prototype.valueHandler=function(e,t){return new Mi(e,t)},Ni.prototype.referenceHandler=function(e){return new ki(e,this.context)},Ni.prototype.handler=function(e){return"Element"===e?new Di(this.model,e,this.context):new Ni(this.model,e,this.context)},Ni.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Hn(n=t.effectiveType||t.type))return this.valueHandler(t,i);var a=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==a&&(t.isMany?i.get(t.name).push(a):i.set(t.name,a),t.isReference?(b(a,{element:i}),this.context.addReference(a)):a.$parent=i),r},Ti.prototype=Object.create(Ni.prototype),Ti.prototype.createElement=function(e){var t=e.name,n=$n(t),i=this.model,r=this.type,a=i.getPackage(n.prefix),o=a&&Ei(n,a)||t;if(!r.hasType(o))throw wi("unexpected element <"+e.originalName+">");return Ni.prototype.createElement.call(this,e)},Di.prototype=Object.create(Pi.prototype),Di.prototype.createElement=function(e){var t=e.name,n=$n(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Di.prototype.handleChild=function(e){var t=new Di(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},Di.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Oi.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof Ni?(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 Ai(b({},t,{rootHandler:i})),s=new di({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function p(e,t,n){var i=t(),r=i.line,a=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var l="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+a+"\n\tnested error: "+e.message;if(n)return o.addWarning({message:l,error:e}),!0;throw wi(l)}function c(e,t){return p(e,t,!0)}i.context=o,l.push(i);var u=/^<\?xml /i,h=/ encoding="([^"]+)"/i,m=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){c(e,t)}}var d=r.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},{});s.ns(d).on("openTag",function(e,t,n,i){var r=e.attrs||{},o=Object.keys(r).reduce(function(e,n){var i=t(r[n]);return e[n]=i,e},{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){p(e,t,a)&&l.push(new Ri)}}({name:e.name,originalName:e.originalName,attributes:o,ns:e.ns},i)}).on("question",function(e){if(u.test(e)){var t=h.exec(e),n=t&&t[1];n&&!m.test(n)&&o.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}}).on("closeTag",function(){l.pop().handleEnd()}).on("cdata",f).on("text",function(e,t,n){!function(e,t){(e=e.trim())&&f(e,t)}(t(e),n)}).on("error",p).on("warn",c),setTimeout(function(){var t;try{s.parse(e),function(){var e,t,n=o.elementsById,i=o.references;for(e=0;t=i[e];e++){var r=t.element,a=n[t.id],s=_i(r).propertiesByName[t.property];if(a||o.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var l=r.get(s.name),p=l.indexOf(t);-1===p&&(p=l.length),a?l[p]=a:l.splice(p,1)}else r.set(s.name,a)}}()}catch(e){t=e}var r=i.element;t||r||(t=wi("failed to parse document as <"+i.type.$descriptor.name+">")),n(t,t?void 0:r,o)},0)},Oi.prototype.handler=function(e){return new Ti(this.model,e)};var Bi='\n',Li=/<|>|'|"|&|\n\r|\n/g,Ii=/<|>|&/g;function Fi(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 ji(e,t){return yi(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function Vi(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Wi(e){return l(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function zi(e){return function(e,t){var n=[];return h(e,function(e,i){n.push(t(e,i))}),n}(e.getUsed(),function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}})}var Gi={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Hi={"<":"lt",">":"gt","&":"amp"};function $i(e,t,n){return(e=l(e)?e:""+e).replace(t,function(e){return"&"+n[e]+";"})}function Ki(e){this.tagName=e}function Ui(){}function qi(e){this.tagName=e}function Yi(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Xi(e,t){Yi.call(this,e,t)}function Zi(){this.value="",this.write=function(e){this.value+=e}}function Ji(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 Qi(e){return e=b({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new Zi,r=new Ji(i,e.format);if(e.preamble&&r.append(Bi),(new Yi).build(t).serializeTo(r),!n)return i.value}}}function er(e,t){Zn.call(this,e,t)}Ki.prototype.build=function(e){return this.element=e,this},Ki.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()},Ui.prototype.serializeValue=Ui.prototype.serializeTo=function(e){e.append(this.escape?$i(this.value,Ii,Hi):this.value)},Ui.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Ii)&&(this.escape=!0),this},Vi(qi,Ui),qi.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()},Yi.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,a=i.isGeneric;return t=a?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),a||(n=function(e){return u(e.$descriptor.properties,function(t){var n=t.name;if(t.isVirtual)return!1;if(!e.hasOwnProperty(n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)})}(e),this.parseAttributes(u(n,function(e){return e.isAttr})),this.parseContainments(function(e){return u(e,function(e){return!e.isAttr})}(n))),this.parseGenericAttributes(e,t),this},Yi.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?b({localName:t.ns.localName},e):b({localName:ji(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},Yi.prototype.nsPropertyTagName=function(e){return function(e,t){return b({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Yi.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Yi.prototype.nsAttributeName=function(e){var t;if(t=l(e)?$n(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:b({localName:t.localName},n)},Yi.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return h(e,function(r,a){"$body"===a?n.push((new Ui).build({type:"String"},r)):"$children"===a?h(r,function(e){n.push(new Yi(t).build(e))}):0!==a.indexOf("$")&&t.parseNsAttribute(e,a,r)&&i.push({name:a,value:r})}),i},Yi.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,a=$n(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)}},Yi.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return h(i,function(t,i){var a=n.parseNsAttribute(e,i,t);a&&r.push(a)}),r},Yi.prototype.parseGenericAttributes=function(e,t){var n=this;h(t,function(t){if(t.name!==vi)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}})},Yi.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;h(e,function(e){var r=i.get(e.name),a=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new Ui).build(e,r[0]));else if(Hn(e.type))h(r,function(i){n.push(new qi(t.addTagName(t.nsPropertyTagName(e))).build(e,i))});else if(a)h(r,function(i){n.push(new Ki(t.addTagName(t.nsPropertyTagName(e))).build(i))});else{var o=bi(e),s=function(e){return"property"===xi(e)}(e);h(r,function(i){var r;r=o?new Xi(t,e):s?new Yi(t,e):new Yi(t),n.push(r.build(i))})}})},Yi.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new Fi(t):n=t),n},Yi.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},Yi.prototype.logNamespaceUsed=function(e,t){var n,i,r,a=this.element.$model,o=this.getNamespaces(t),s=e.prefix,l=e.uri;if(!s&&!l)return{localName:e.localName};if(r=gi[s]||a&&(a.getPackage(s)||{}).uri,!(l=l||r||o.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=o.byUri(l))){for(n=s,i=1;o.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:l},r===l)}return s&&o.mapPrefix(s,l),e},Yi.prototype.parseAttributes=function(e){var t=this,n=this.element;h(e,function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];h(i,function(e){r.push(e.id)}),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)})},Yi.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Wi(e)},Yi.prototype.addAttribute=function(e,t){var n=this.attrs;l(t)&&(t=$i(t,Li,Gi)),n.push({name:e,value:t})},Yi.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=zi(n).concat(t)),h(t,function(t){e.append(" ").append(Wi(t.name)).append('="').append(t.value).append('"')})},Yi.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Ui;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),h(this.body,function(t){t.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("")),e.appendNewLine()},Vi(Xi,Yi),Xi.prototype.parseNsAttributes=function(e){var t=Yi.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(vi),(i.prefix?i.prefix+":":"")+a+n.ns.localName),t},Xi.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},er.prototype=Object.create(Zn.prototype),er.prototype.fromXML=function(e,t,n,i){l(t)||(i=n,n=t,t="bpmn:Definitions"),s(n)&&(i=n,n={});var r=new Oi(b({model:this,lax:!0},n)),a=r.handler(t);r.fromXML(e,a,i)},er.prototype.toXML=function(e,t,n){s(t)&&(n=t,t={});var i,r,a=new Qi(t);try{i=a.toXML(e)}catch(e){r=e}return n(r,i)};var tr={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"],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:[]}};function nr(e,t){return new er(b({},tr,e),t)}var ir=new yn({name:"bpmnElement",enumerable:!0},{name:"di",configurable:!0});function rr(e,t){return e.$instanceOf(t)}function ar(e,t){var n={},i=[];function r(e,t){return function(n){e(n,t)}}function a(e){n[e.id]=e}function o(n,i){try{var r=n.di&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:ut(n)}));return e.element(n,i)}(n,i);return a(n),r}catch(e){s(e.message,{element:n,error:e}),console.error(t("failed to import {element}",{element:ut(n)})),console.error(e)}}function s(t,n){e.error(t,n)}function l(e){var n=e.bpmnElement;n?n.di?s(t("multiple DI elements defined for {element}",{element:ut(n)}),{element:n}):(ir.bind(n,"di"),n.di=e):s(t("no bpmnElement referenced in {element}",{element:ut(e)}),{element:e})}function p(e){var t;l(t=e.plane),h(t.planeElement,m)}function m(e){l(e)}function f(){for(;i.length;)i.shift()()}function d(e,t){k(e,t),w(e.ioSpecification,t),E(e.artifacts,t),a(e)}function y(e,t){o(e,t)}function g(e,t){o(e,t)}function v(e,t){o(e,t)}function x(e,t){o(e,t)}function b(e,t){o(e,t)}function E(e,t){h(e,function(e){rr(e,"bpmn:Association")?i.push(function(){b(e,t)}):b(e,t)})}function w(e,t){e&&(h(e.dataInputs,r(v,t)),h(e.dataOutputs,r(x,t)))}function _(e,t){k(e,t),E(e.artifacts,t)}function A(e,t){var n=o(e,t);rr(e,"bpmn:SubProcess")&&_(e,n||t),rr(e,"bpmn:Activity")&&w(e.ioSpecification,t),i.push(function(){h(e.dataInputAssociations,r(g,t)),h(e.dataOutputAssociations,r(g,t))})}function S(e,t){o(e,t)}function R(e,t){i.push(function(){var n=o(e,t);e.childLaneSet&&C(e.childLaneSet,n||t),function(e){h(e.flowNodeRef,function(t){var n=t.get("lanes");n&&n.push(e)})}(e)})}function C(e,t){h(e.lanes,r(R,t))}function k(e,n){!function(e,n){h(e,function(e){rr(e,"bpmn:SequenceFlow")?i.push(function(){!function(e,t){o(e,t)}(e,n)}):rr(e,"bpmn:BoundaryEvent")?i.unshift(function(){A(e,n)}):rr(e,"bpmn:FlowNode")?A(e,n):rr(e,"bpmn:DataObject")||(rr(e,"bpmn:DataStoreReference")?S(e,n):rr(e,"bpmn:DataObjectReference")?S(e,n):s(t("unrecognized flowElement {element} in context {context}",{element:ut(e),context:n?ut(n.businessObject):"null"}),{element:e,context:n}))})}(e.flowElements,n),e.laneSets&&function(e,t){h(e,r(C,t))}(e.laneSets,n)}function M(e,t){var n=o(e,t),i=e.processRef;i&&d(i,n||t)}return{handleDeferred:f,handleDefinitions:function(a,o){var m=a.diagrams;if(o&&-1===m.indexOf(o))throw new Error(t("diagram not part of bpmn:Definitions"));if(!o&&m&&m.length&&(o=m[0]),!o)throw new Error(t("no diagram to display"));p(o);var g=o.plane;if(!g)throw new Error(t("no plane for {element}",{element:ut(o)}));var v=g.bpmnElement;if(!v){if(!(v=function(e){return c(e.rootElements,function(e){return rr(e,"bpmn:Process")||rr(e,"bpmn:Collaboration")})}(a)))throw new Error(t("no process or collaboration to display"));s(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:ut(g),rootElement:ut(v)})),g.bpmnElement=v,l(g)}var x,b=function(t,n){return e.root(t,n)}(v,g);if(rr(v,"bpmn:Process"))d(v,b);else{if(!rr(v,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:ut(g),rootElement:ut(v)}));h((x=v).participants,r(M)),E(x.artifacts),i.push(function(){var e;h(x.messageFlows,r(y,e))}),function(e,t){u(e,function(e){return!n[e.id]&&rr(e,"bpmn:Process")&&e.laneSets}).forEach(r(d,t))}(a.rootElements,b)}f()},handleSubProcess:_,registerDi:l}} + * This file must not be changed or exchanged. + * + * @see http://bpmn.io/license for more information. + */(i));n=k(r,"bpmn:Collaboration")?r:u(e.rootElements,(function(e){if(k(e,"bpmn:Collaboration"))return u(e.participants,(function(e){return e.processRef===r}))}));var o=[r];n&&(o=function(e,t){let n=[];return f(e,(function(e,i){n.push(t(e,i))})),n}(n.participants,(function(e){return e.processRef}))).push(n);var a=Dr(o),s=[t],l=[i];return f(e.diagrams,(function(e){var t=e.plane.bpmnElement;-1!==a.indexOf(t)&&-1===l.indexOf(t)&&(s.push(e),l.push(t))})),s}(e,t);if(!r)throw new Error(o("no diagram to display"));f(r,(function(t){n.handleDefinitions(e,t)}));var l=t.plane.bpmnElement.id;a.setRootElement(a.findRoot(l+"_plane")||a.findRoot(l))}return new Promise((function(p,c){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("translate"),a=e.get("canvas"),r.fire("import.render.start",{definitions:t}),l(t,n),r.fire("import.render.complete",{error:undefined,warnings:s}),p({warnings:s})}catch(e){return e.warnings=s,c(e)}}))}function Dr(e){var t=[];return f(e,(function(e){e&&(t.push(e),t=t.concat(Dr(e.flowElements)))})),t}var Br,Lr='',Ir={verticalAlign:"middle"},jr={color:"#404040"},Fr={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},Vr={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},Wr={position:"absolute",left:"50%",top:"40%",transform:"translate(-50%)",width:"260px",padding:"10px",background:"white",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"14px",display:"flex",lineHeight:"1.3"},zr='
    '+Lr+'Web-based tooling for BPMN, DMN and forms powered by bpmn.io.
    ';function $r(){Br||(Te(Br=Ze(zr),Fr),Te(Je("svg",Br),Ir),Te(Je(".backdrop",Br),Vr),Te(Je(".notice",Br),Wr),Te(Je(".link",Br),jr,{margin:"15px 20px 15px 10px",alignSelf:"center"}),Ue.bind(Br,".backdrop","click",(function(e){document.body.removeChild(Br)}))),document.body.appendChild(Br)} /** - * This file must not be changed or exchanged. - * - * @see http://bpmn.io/license for more information. - */ -var or=''))+'" />';function sr(e){return e.join(";")}var lr,pr='
    '+or+'Web-based tooling for BPMN, DMN and CMMN diagrams powered by bpmn.io.
    '; + * The code in the area + * must not be changed. + * + * @see http://bpmn.io/license for more information. + */function Gr(e){e=E({},Kr,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e), /** - * The code in the area - * must not be changed. - * - * @see http://bpmn.io/license for more information. - */ -function cr(e){ -/** - * Adds the project logo to the diagram container as - * required by the bpmn.io license. - * - * @see http://bpmn.io/license - * - * @param {Element} container - */ -var t,n;e=b({},ur,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,n=Ne(''+or+""),t.appendChild(n),ke.bind(n,"click",function(e){lr||(lr=Ne(pr),Pe.bind(lr,".backdrop","click",function(e){document.body.removeChild(lr)})),document.body.appendChild(lr),e.preventDefault()}),this._init(this._container,this._moddle,e)}e(cr,In),cr.prototype.importXML=function(e,t,n){s(t)&&(n=t,t=null),n=n||function(){};var i=this;e=this._emit("import.parse.start",{xml:e})||e,this._moddle.fromXML(e,"bpmn:Definitions",function(e,r,a){r=i._emit("import.parse.complete",{error:e,definitions:r,context:a})||r;var o=a.warnings;if(e)return e=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),i._emit("import.done",{error:e,warnings:o}),n(e,o);i.importDefinitions(r,t,function(e,t){var r=[].concat(o,t||[]);i._emit("import.done",{error:e,warnings:r}),n(e,r)})})},cr.prototype.importDefinitions=function(e,t,n){return s(t)&&(n=t,t=null),n=n||function(){},this._setDefinitions(e),this.open(t,n)},cr.prototype.open=function(e,t){s(e)&&(t=e,e=null);var n=this._definitions,i=e;if(t=t||function(){},!n)return t(new Error("no XML imported"));if("string"==typeof e&&!(i=function(e,t){if(!t)return null;return c(e.diagrams,function(e){return e.id===t})||null}(n,e)))return t(new Error("BPMNDiagram <"+e+"> not found"));try{this.clear()}catch(e){return t(e)}return function(e,t,n,i){var r,a,o;s(n)&&(i=n,n=null);var l,p=[];try{r=e.get("bpmnImporter"),a=e.get("eventBus"),o=e.get("translate"),a.fire("import.render.start",{definitions:t}),function(e,t){new ar({root:function(e){return r.add(e)},element:function(e,t){return r.add(e,t)},error:function(e,t){p.push({message:e,context:t})}},o).handleDefinitions(e,t)}(t,n),a.fire("import.render.complete",{error:l,warnings:p})}catch(e){l=e}i(l,p)}(this,n,i,t)},cr.prototype.saveXML=function(e,t){t||(t=e,e={});var n=this,i=this._definitions;if(!i)return t(new Error("no definitions loaded"));i=this._emit("saveXML.start",{definitions:i})||i,this._moddle.toXML(i,e,function(e,i){try{i=n._emit("saveXML.serialized",{error:e,xml:i})||i,n._emit("saveXML.done",{error:e,xml:i})}catch(e){console.error("error in saveXML life-cycle listener",e)}t(e,i)})},cr.prototype.saveSVG=function(e,t){var n,i;t||(t=e,e={}),this._emit("saveSVG.start");try{var r=this.get("canvas"),a=r.getDefaultLayer(),o=Oe("defs",r._svg),s=Q(a),l=o?""+Q(o)+"":"",p=a.getBBox();n='\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n\n'+l+s+""}catch(e){i=e}this._emit("saveSVG.done",{error:i,svg:n}),t(i,n)},cr.prototype._setDefinitions=function(e){this._definitions=e},cr.prototype.getModules=function(){return this._modules},cr.prototype.clear=function(){this.getDefinitions()&&(this.get("elementRegistry").forEach(function(e){var t=e.businessObject;t&&t.di&&delete t.di}),In.prototype.clear.call(this))},cr.prototype.destroy=function(){In.prototype.destroy.call(this),Be(this._container)},cr.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},cr.prototype.off=function(e,t){this.get("eventBus").off(e,t)},cr.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=Oe(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},cr.prototype.getDefinitions=function(){return this._definitions},cr.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},cr.prototype._init=function(e,t,n){var i,r,a=n.modules||this.getModules(),o=n.additionalModules||[],s=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],a,o),l=b((i=["additionalModules"],r={},h(Object(n),function(e,t){-1===i.indexOf(t)&&(r[t]=e)}),r),{canvas:b({},n.canvas,{container:e}),modules:s});In.call(this,l),n&&n.container&&this.attachTo(n.container)},cr.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},cr.prototype._createContainer=function(e){var t=Ne('
    ');return b(t.style,{width:hr(e.width),height:hr(e.height),position:e.position}),t},cr.prototype._createModdle=function(e){return new nr(b({},this._moddleExtensions,e.moddleExtensions))},cr.prototype._modules=[];var ur={width:"100%",height:"100%",position:"relative"};function hr(e){return e+(o(e)?"px":"")}function mr(e){cr.call(this,e)}function fr(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function dr(e,t){return-1!==(e=r(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.keyCode)}function yr(e){return e.shiftKey}e(mr,cr),mr.prototype._modules=[yt,at,Lt,Gt],mr.prototype._moddleExtensions={};function gr(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()})}gr.$inject=["config.keyboard","eventBus"],gr.prototype._keydownHandler=function(e){this._keyHandler(e,"keyboard.keydown")},gr.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},gr.prototype._keyHandler=function(e,t){if(!function(e){return e&&(xe(e,"input, textarea")||"true"===e.contentEditable)}(e.target)){var n={keyEvent:e};this._eventBus.fire(t||"keyboard.keydown",n)&&e.preventDefault()}},gr.prototype.bind=function(e){this.unbind(),this._node=e,ke.bind(e,"keydown",this._keydownHandler,!0),ke.bind(e,"keyup",this._keyupHandler,!0),this._fire("bind")},gr.prototype.getBinding=function(){return this._node},gr.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),ke.unbind(e,"keydown",this._keydownHandler,!0),ke.unbind(e,"keyup",this._keyupHandler,!0)),this._node=null},gr.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},gr.prototype.addListener=function(e,t,n){s(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||"keyboard.keydown",e,t)},gr.prototype.removeListener=function(e,t){this._eventBus.off(t||"keyboard.keydown",e)},gr.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},gr.prototype.isCmd=fr,gr.prototype.isShift=yr,gr.prototype.isKey=dr;var vr=500,xr=["c","C",67],br=["v","V",86],Er=["y","Y",89],wr=["z","Z",90];function _r(e,t){var n=this;e.on("editorActions.init",vr,function(e){var i=e.editorActions;n.registerBindings(t,i)})}_r.$inject=["eventBus","keyboard"],_r.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",function(e){var n=e.keyEvent;if(fr(n)&&!yr(n)&&dr(wr,n))return t.trigger("undo"),!0}),n("redo",function(e){var n=e.keyEvent;if(fr(n)&&(dr(Er,n)||dr(wr,n)&&yr(n)))return t.trigger("redo"),!0}),n("copy",function(e){var n=e.keyEvent;if(fr(n)&&dr(xr,n))return t.trigger("copy"),!0}),n("paste",function(e){var n=e.keyEvent;if(fr(n)&&dr(br,n))return t.trigger("paste"),!0}),n("stepZoom",function(e){var n=e.keyEvent;if(dr(["+","Add"],n)&&fr(n))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(e){var n=e.keyEvent;if(dr(["-","Subtract"],n)&&fr(n))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(e){var n=e.keyEvent;if(dr("0",n)&&fr(n))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(e){if(dr(["Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0})};var Ar={__init__:["keyboard","keyboardBindings"],keyboard:["type",gr],keyboardBindings:["type",_r]},Sr={moveSpeed:50,moveSpeedAccelerated:200};function Rr(e,t,n){var i=this;this._config=b({},Sr,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})}}Rr.$inject=["config.keyboardMove","keyboard","canvas"];var Cr={__depends__:[Ar],__init__:["keyboardMove"],keyboardMove:["type",Rr]},kr=/^djs-cursor-.*$/;function Mr(e){var t=fe(document.body);t.removeMatching(kr),e&&t.add("djs-cursor-"+e)}var Pr=5e3;function Nr(e,t){return{x:e.x-t.x,y:e.y-t.y}}var Tr=15;function Dr(e,t){var n;function i(i){var r,a=n.start,o=vt(i),s=Nr(o,a);(!n.dragging&&(r=s,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>Tr)&&(n.dragging=!0,function(e,t){function n(){return!1}t=t||"element.click",e.once(t,Pr,n)}(e),Mr("grab")),n.dragging)&&(s=Nr(o,n.last||n.start),t.scroll({dx:s.x,dy:s.y}),n.last=o);i.preventDefault()}function r(e){ke.unbind(document,"mousemove",i),ke.unbind(document,"mouseup",r),n=null,Mr(null)}e.on("element.mousedown",500,function(e){return function(e){if(be(e.target,".djs-draggable"))return;if(e.button||e.ctrlKey||e.shiftKey||e.altKey)return;return n={start:vt(e)},ke.bind(document,"mousemove",i),ke.bind(document,"mouseup",r),!0}(e.originalEvent)})}Dr.$inject=["eventBus","canvas"];var Or={__init__:["moveCanvas"],moveCanvas:["type",Dr]};function Br(e){return Math.log(e)/Math.log(10)}function Lr(e,t){var n=Br(e.min),i=Br(e.max);return(Math.abs(n)+Math.abs(i))/t}var Ir=Math.sign||function(e){return e>=0?1:-1},Fr={min:.2,max:4},jr=.75;function Vr(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=v(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||jr;var i=this;t.on("canvas.init",function(t){i._init(!1!==e.enabled)})}Vr.$inject=["config.zoomScroll","eventBus","canvas"],Vr.prototype.scroll=function(e){this._canvas.scroll(e)},Vr.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Vr.prototype.zoom=function(e,t){var n=Lr(Fr,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},Vr.prototype._handleWheel=function(e){if(!be(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))*Ir(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)}},Vr.prototype.stepZoom=function(e,t){var n=Lr(Fr,10);this._zoom(e,t,n)},Vr.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,a=Br(i.zoom()),o=Math.round(a/n)*n;o+=n*r;var s,l,p=Math.pow(10,o);i.zoom((s=Fr,l=p,Math.max(s.min,Math.min(s.max,l))),t)},Vr.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&ke[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Vr.prototype._init=function(e){this.toggle(e)};var Wr={__init__:["zoomScroll"],zoomScroll:["type",Vr]};function zr(e){mr.call(this,e)}return e(zr,mr),zr.prototype._navigationModules=[Cr,Or,Wr],zr.prototype._modules=[].concat(mr.prototype._modules,zr.prototype._navigationModules),zr}); + * Adds the project logo to the diagram container as + * required by the bpmn.io license. + * + * @see http://bpmn.io/license + * + * @param {Element} container + */ +function(e){const t=Ze(''+Lr+"");Te(Je("svg",t),Ir),Te(t,jr,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),Ge.bind(t,"click",(function(e){$r(),e.preventDefault()}))}(this._container),this._init(this._container,this._moddle,e)}function Hr(e,t){return e.warnings=t,e}e(Gr,fi),Gr.prototype.importXML=async function(e,t){const n=this;let i=[];try{let o;e=this._emit("import.parse.start",{xml:e})||e;try{o=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(e){throw this._emit("import.parse.complete",{error:e}),e}let a=o.rootElement;const s=o.references,l=o.warnings,p=o.elementsById;i=i.concat(l),a=this._emit("import.parse.complete",(r={error:null,definitions:a,elementsById:p,references:s,warnings:i},n.get("eventBus").createEvent(r)))||a;const c=await this.importDefinitions(a,t);return i=i.concat(c.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),Hr(t,i),t=function(e){const 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}(t),this._emit("import.done",{error:t,warnings:t.warnings}),t}var r},Gr.prototype.importDefinitions=async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}},Gr.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw Hr(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return u(e.diagrams,(function(e){return e.id===t}))||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw Hr(t,[]),t}try{this.clear()}catch(e){throw Hr(e,[]),e}const{warnings:i}=await Or(this,t,n);return{warnings:i}},Gr.prototype.saveXML=async function(e){e=e||{};let t,n,i=this._definitions;try{if(!i)throw new Error("no definitions loaded");i=this._emit("saveXML.start",{definitions:i})||i;n=(await this._moddle.toXML(i,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(e){t=e}const r=t?{error:t}:{xml:n};if(this._emit("saveXML.done",r),t)throw t;return r},Gr.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),i=Je("defs",t._svg),r=ae(n),o=i?""+ae(i)+"":"",a=n.getBBox();e='\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n\n'+o+r+""}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},Gr.prototype._setDefinitions=function(e){this._definitions=e},Gr.prototype.getModules=function(){return this._modules},Gr.prototype.clear=function(){this.getDefinitions()&&fi.prototype.clear.call(this)},Gr.prototype.destroy=function(){fi.prototype.destroy.call(this),Qe(this._container)},Gr.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},Gr.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Gr.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=Je(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Gr.prototype.getDefinitions=function(){return this._definitions},Gr.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Gr.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),a=E(function(e,t){let n={};return f(Object(e),(function(e,i){-1===t.indexOf(i)&&(n[i]=e)})),n}(n,["additionalModules"]),{canvas:E({},n.canvas,{container:e}),modules:o});fi.call(this,a),n&&n.container&&this.attachTo(n.container)},Gr.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Gr.prototype._createContainer=function(e){const t=Ze('
    ');return Te(t,{width:Ur(e.width),height:Ur(e.height),position:e.position}),t},Gr.prototype._createModdle=function(e){return new Mr(E({},this._moddleExtensions,e.moddleExtensions))},Gr.prototype._modules=[];const Kr={width:"100%",height:"100%",position:"relative"};function Ur(e){return e+(s(e)?"px":"")}function qr(e){Gr.call(this,e)}e(qr,Gr),qr.prototype._modules=[Pt,wt,Zt,on,An],qr.prototype._moddleExtensions={};var Yr=["c","C"],Xr=["v","V"],Zr=["y","Y"],Jr=["z","Z"];function Qr(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function eo(e,t){return-1!==(e=o(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.code)}function to(e){return e.shiftKey}var no="keyboard.keydown",io="input-handle-modified-keys";function ro(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()}))}ro.$inject=["config.keyboard","eventBus"],ro.prototype._keydownHandler=function(e){this._keyHandler(e,no)},ro.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},ro.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||no,n)&&e.preventDefault()}},ro.prototype._isEventIgnored=function(e){return!!e.defaultPrevented||(t=e.target)&&(Ie(t,"input, textarea")||"true"===t.contentEditable)&&this._isModifiedKeyIgnored(e);var t},ro.prototype._isModifiedKeyIgnored=function(e){return!Qr(e)||-1===this._getAllowedModifiers(e.target).indexOf(e.key)},ro.prototype._getAllowedModifiers=function(e){var t=je(e,"["+io+"]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(io).split(",")},ro.prototype.bind=function(e){this.unbind(),this._node=e,Ge.bind(e,"keydown",this._keydownHandler),Ge.bind(e,"keyup",this._keyupHandler),this._fire("bind")},ro.prototype.getBinding=function(){return this._node},ro.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),Ge.unbind(e,"keydown",this._keydownHandler),Ge.unbind(e,"keyup",this._keyupHandler)),this._node=null},ro.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},ro.prototype.addListener=function(e,t,n){l(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||no,e,t)},ro.prototype.removeListener=function(e,t){this._eventBus.off(t||no,e)},ro.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},ro.prototype.isCmd=Qr,ro.prototype.isShift=to,ro.prototype.isKey=eo;function oo(e,t){var n=this;e.on("editorActions.init",500,(function(e){var i=e.editorActions;n.registerBindings(t,i)}))}oo.$inject=["eventBus","keyboard"],oo.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",(function(e){if(function(e){return Qr(e)&&!to(e)&&eo(Jr,e)}(e.keyEvent))return t.trigger("undo"),!0})),n("redo",(function(e){if(function(e){return Qr(e)&&(eo(Zr,e)||eo(Jr,e)&&to(e))}(e.keyEvent))return t.trigger("redo"),!0})),n("copy",(function(e){if(function(e){return Qr(e)&&eo(Yr,e)}(e.keyEvent))return t.trigger("copy"),!0})),n("paste",(function(e){if(function(e){return Qr(e)&&eo(Xr,e)}(e.keyEvent))return t.trigger("paste"),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(eo(["+","Add","="],n)&&Qr(n))return t.trigger("stepZoom",{value:1}),!0})),n("stepZoom",(function(e){var n=e.keyEvent;if(eo(["-","Subtract"],n)&&Qr(n))return t.trigger("stepZoom",{value:-1}),!0})),n("zoom",(function(e){var n=e.keyEvent;if(eo("0",n)&&Qr(n))return t.trigger("zoom",{value:1}),!0})),n("removeSelection",(function(e){if(eo(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0}))};var ao={__init__:["keyboard","keyboardBindings"],keyboard:["type",ro],keyboardBindings:["type",oo]},so={moveSpeed:50,moveSpeedAccelerated:200};function lo(e,t,n){var i=this;this._config=E({},so,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 o,a=t.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down"}return i.moveCanvas({speed:a,direction:o}),!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})}}lo.$inject=["config.keyboardMove","keyboard","canvas"];var po={__depends__:[ao],__init__:["keyboardMove"],keyboardMove:["type",lo]},co=/^djs-cursor-.*$/;function uo(e){var t=De(document.body);t.removeMatching(co),e&&t.add("djs-cursor-"+e)}var ho=5e3;function fo(e,t){return{x:e.x-t.x,y:e.y-t.y}}function mo(e,t){var n;function i(i){var r,o=n.start,a=n.button,s=Tt(i),l=fo(s,o);(!n.dragging&&(r=l,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===a&&function(e,t){function n(){return!1}t=t||"element.click",e.once(t,ho,n)}(e),uo("grab")),n.dragging)&&(l=fo(s,n.last||n.start),t.scroll({dx:l.x,dy:l.y}),n.last=s);i.preventDefault()}function r(e){Ge.unbind(document,"mousemove",i),Ge.unbind(document,"mouseup",r),n=null,uo(null)}e.on("element.mousedown",500,(function(e){return function(e){if(je(e.target,".djs-draggable"))return;var t=e.button;if(t>=2||e.ctrlKey||e.shiftKey||e.altKey)return;return n={button:t,start:Tt(e)},Ge.bind(document,"mousemove",i),Ge.bind(document,"mouseup",r),!0}(e.originalEvent)})),this.isActive=function(){return!!n}}mo.$inject=["eventBus","canvas"];var yo={__init__:["moveCanvas"],moveCanvas:["type",mo]};function go(e){return Math.log(e)/Math.log(10)}function vo(e,t){var n=go(e.min),i=go(e.max);return(Math.abs(n)+Math.abs(i))/t}var xo=Math.sign||function(e){return e>=0?1:-1},wo={min:.2,max:4};function bo(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=b(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)}))}bo.$inject=["config.zoomScroll","eventBus","canvas"],bo.prototype.scroll=function(e){this._canvas.scroll(e)},bo.prototype.reset=function(){this._canvas.zoom("fit-viewport")},bo.prototype.zoom=function(e,t){var n=vo(wo,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},bo.prototype._handleWheel=function(e){if(!je(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey||Ot()&&e.metaKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var a=t.getBoundingClientRect(),s={x:e.clientX-a.left,y:e.clientY-a.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*xo(e.deltaY)*o,this.zoom(n,s)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},bo.prototype.stepZoom=function(e,t){var n=vo(wo,10);this._zoom(e,t,n)},bo.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=go(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s,l,p=Math.pow(10,a);i.zoom((s=wo,l=p,Math.max(s.min,Math.min(s.max,l))),t)},bo.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&Ge[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},bo.prototype._init=function(e){this.toggle(e)};var Eo={__init__:["zoomScroll"],zoomScroll:["type",bo]};function _o(e){qr.call(this,e)}return e(_o,qr),_o.prototype._navigationModules=[po,yo,Eo],_o.prototype._modules=[].concat(qr.prototype._modules,_o.prototype._navigationModules),_o})); diff --git a/src/main/resources/templates/components/bpmn-diagram.html b/src/main/resources/templates/components/bpmn-diagram.html index a3ddcd1a..788ccab6 100644 --- a/src/main/resources/templates/components/bpmn-diagram.html +++ b/src/main/resources/templates/components/bpmn-diagram.html @@ -3,106 +3,102 @@
    - diff --git a/src/main/resources/templates/layout/header.html b/src/main/resources/templates/layout/header.html index 11d63a49..a5711379 100644 --- a/src/main/resources/templates/layout/header.html +++ b/src/main/resources/templates/layout/header.html @@ -12,6 +12,7 @@ +