1"use strict";(self.webpackChunknetnr=self.webpackChunknetnr||[]).push([[4502],{14502(e,t,n){function i(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}n.d(t,{default:()=>fP});var r,o,a,s,c,l={exports:{}},p=(r=function(){if(a)return l.exports;a=1;var e=l.exports=function(t,n){if(n||(n=16),void 0===t&&(t=128),t<=0)return"0";for(var i=Math.log(Math.pow(2,t))/Math.log(n),r=2;1/0===i;r*=2)i=Math.log(Math.pow(2,t/r))/Math.log(n)*r;for(var o=i-Math.floor(i),a="",r=0;r<Math.floor(i);r++){var s=Math.floor(Math.random()*n).toString(n);a=s+a}if(o){var s=Math.floor(Math.random()*Math.pow(n,o)).toString(n);a=s+a}var c=parseInt(a,n);return 1/0!==c&&c>=Math.pow(2,t)?e(t,n):a};return e.rack=function(t,n,i){var r=function(r){var a=0;do{if(a++>10)if(i)t+=i;else throw Error("too many ID collisions, use more bits");var s=e(t,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=t||128,r.base=n||16,r},l.exports}())&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;function u(e){if(!(this instanceof u))return new u(e);e=e||[128,36,1],this._seed=e.length?p.rack(e[0],e[1],e[2]):e}function h(e){return Array.prototype.concat.apply([],e)}u.prototype.next=function(e){return this._seed(e||!0)},u.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n))return this.claim(n,t),n},u.prototype.claim=function(e,t){this._seed.set(e,t||!0)},u.prototype.assigned=function(e){return this._seed.get(e)||!1},u.prototype.unclaim=function(e){delete this._seed.hats[e]},u.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};let d=Object.prototype.toString,f=Object.prototype.hasOwnProperty;function m(e){return void 0===e}function g(e){return void 0!==e}function y(e){return null==e}function v(e){return"[object Array]"===d.call(e)}function b(e){return"[object Object]"===d.call(e)}function _(e){return"[object Number]"===d.call(e)}function x(e){let t=d.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function w(e){return"[object String]"===d.call(e)}function E(e,t){return!y(e)&&f.call(e,t)}function S(e,t){let n,i=I(t);return R(e,function(e,t){if(i(e,t))return n=e,!1}),n}function k(e,t){let n=I(t),i=v(e)?-1:void 0;return R(e,function(e,t){if(n(e,t))return i=t,!1}),i}function C(e,t){let n=I(t),i=[];return R(e,function(e,t){n(e,t)&&i.push(e)}),i}function R(e,t){let n;if(m(e))return;let i=v(e)?z:F;for(let r in e)if(E(e,r)&&!1===t(n=e[r],i(r)))return n}function P(e,t,n){return R(e,function(e,i){n=t(n,e,i)}),n}function A(e,t){return!!P(e,function(e,n,i){return e&&t(n,i)},!0)}function M(e,t){return!!S(e,t)}function T(e,t){let n=[];return R(e,function(e,i){n.push(t(e,i))}),n}function B(e){return e&&Object.keys(e)||[]}function D(e){return T(e,e=>e)}function j(e,t,n={}){return t=$(t),R(e,function(e){let i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)}),n}function O(e,...t){e=$(e);let n={};return R(t,t=>j(t,e,n)),T(n,function(e,t){return e[0]})}function N(e,t){t=$(t);let n=[];return R(e,function(e,i){let r=t(e,i),o={d:r,v:e};for(var a=0;a<n.length;a++){let{d:e}=n[a];if(r<e)return void n.splice(a,0,o)}n.push(o)}),T(n,e=>e.v)}function L(e){return function(t){return A(e,function(e,n){return t[n]===e})}}function $(e){return x(e)?e:t=>t[e]}function I(e){return x(e)?e:t=>t===e}function F(e){return e}function z(e){return Number(e)}function H(e,t){let n,i,r,o;function a(n){let a=Date.now(),l=n?0:o+t-a;if(l>0)return s(l);e.apply(r,i),c()}function s(e){n=setTimeout(a,e)}function c(){n&&clearTimeout(n),n=o=i=r=void 0}function l(...e){o=Date.now(),i=e,r=this,n||s(t)}return l.flush=function(){n&&a(!0),c()},l.cancel=c,l}function V(e,t){return e.bind(t)}function G(e,...t){return Object.assign(e,...t)}function W(e,t){let n={},i=Object(e);return R(t,function(t){t in i&&(n[t]=e[t])}),n}function U(e,t){let n={};return R(Object(e),function(e,i){-1===t.indexOf(i)&&(n[i]=e)}),n}function q(e,...t){let n=e.style;return R(t,function(e){e&&R(e,function(e,t){n[t]=e})}),e}function K(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}let Y=Object.prototype.toString;function X(e){return new Z(e)}function Z(e){if(!e||!e.nodeType)throw Error("A DOM element reference is required");this.el=e,this.list=e.classList}function J(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Q(e,t,n){var i=n?e:e.parentNode;return i&&"function"==typeof i.closest&&i.closest(t)||null}Z.prototype.add=function(e){return this.list.add(e),this},Z.prototype.remove=function(e){return"[object RegExp]"==Y.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Z.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Z.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Z.prototype.array=function(){return Array.from(this.list)},Z.prototype.has=Z.prototype.contains=function(e){return this.list.contains(e)};var ee={},et=function(){var e,t,n;if(s)return ee;function i(){e=window.addEventListener?"addEventListener":"attachEvent",t=window.removeEventListener?"removeEventListener":"detachEvent",n="addEventListener"!==e?"on":""}return s=1,ee.bind=function(t,r,o,a){return e||i(),t[e](n+r,o,a||!1),o},ee.unbind=function(e,r,o,a){return t||i(),e[t](n+r,o,a||!1),o},ee}(),en=(o={__proto__:null,default:et&&et.__esModule&&Object.prototype.hasOwnProperty.call(et,"default")?et.default:et},[et].forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(t){if("default"!==t&&!(t in o)){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})}),Object.freeze(o)),ei=["focus","blur"],er=function(e,t,n,i,r){return -1!==ei.indexOf(n)&&(r=!0),en.bind(e,n,function(n){var r=n.target||n.srcElement;n.delegateTarget=Q(r,t,!0),n.delegateTarget&&i.call(e,n)},r)},eo=function(e,t,n,i){return -1!==ei.indexOf(t)&&(i=!0),en.unbind(e,t,n,i)};function ea(e,t){return e&&"function"==typeof e.matches&&e.matches(t)||!1}function es(e,t){return(t=t||document).querySelector(e)}function ec(e,t){return(t=t||document).querySelectorAll(e)}function el(e){e.parentNode&&e.parentNode.removeChild(e)}let ep={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};function eu(e,t=globalThis.document){var n;if("string"!=typeof e)throw TypeError("String expected");let i=/^<!--(.*?)-->$/s.exec(e);if(i)return t.createComment(i[1]);let r=null==(n=/<([\w:]+)/.exec(e))?void 0:n[1];if(!r)return t.createTextNode(e);if(e=e.trim(),"body"===r){let n=t.createElement("html");n.innerHTML=e;let{lastChild:i}=n;return i.remove(),i}let[o,a,s]=Object.hasOwn(ep,r)?ep[r]:ep._default,c=t.createElement("div");for(c.innerHTML=a+e+s;o--;)c=c.lastChild;if(c.firstChild===c.lastChild){let{firstChild:e}=c;return e.remove(),e}let l=t.createDocumentFragment();return l.append(...c.childNodes),l}function eh(e,t){return t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}(e,t))}function ed(e,t){return eh(t,e),e}ep.td=ep.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],ep.option=ep.optgroup=[1,'<select multiple="multiple">',"</select>"],ep.thead=ep.tbody=ep.colgroup=ep.caption=ep.tfoot=[1,"<table>","</table>"],ep.polyline=ep.ellipse=ep.polygon=ep.circle=ep.text=ep.line=ep.path=ep.rect=ep.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var ef={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":2,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode
1-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function em(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=ef[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function eg(e,t,n){if("string"==typeof t)if(void 0===n)return ef[t]?e.style[t]:e.getAttributeNS(null,t);else em(e,t,n);else{var i,r,o=Object.keys(t);for(i=0;r=o[i];i++)em(e,r,t[r])}return e}let ey=Object.prototype.toString;function ev(e){return new eb(e)}function eb(e){if(!e||!e.nodeType)throw Error("A DOM element reference is required");this.el=e,this.list=e.classList}function e_(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function ex(e){return e.cloneNode(!0)}eb.prototype.add=function(e){return this.list.add(e),this},eb.prototype.remove=function(e){return"[object RegExp]"==ey.call(e)?this.removeMatching(e):(this.list.remove(e),this)},eb.prototype.removeMatching=function(e){let t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},eb.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},eb.prototype.array=function(){return Array.from(this.list)},eb.prototype.has=eb.prototype.contains=function(e){return this.list.contains(e)};var ew="http://www.w3.org/2000/svg",eE='<svg xmlns="'+ew+'"';function eS(e){var t,n,i=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(ew)&&(e=eE+e.substring(4)):(e=eE+">"+e+"</svg>",i=!0);var r=(t=e,(n=new DOMParser).async=!1,n.parseFromString(t,"text/xml"));if(!i)return r;for(var o=document.createDocumentFragment(),a=r.firstChild;a.firstChild;)o.appendChild(a.firstChild);return o}function ek(e,t){var n;return"<"===(e=e.trim()).charAt(0)?(n=eS(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(ew,e),t&&eg(n,t),n}var eC=null;function eR(){return null===eC&&(eC=ek("svg")),eC}function eP(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function eA(e){return e?eR().createSVGTransformFromMatrix(e):eR().createSVGTransform()}var eM=/([&<>]{1})/g,eT=/([&<>\n\r"]{1})/g,eB={"&":"&","<":"<",">":">",'"':"'"};function eD(e,t){return e.replace(t,function(e,t){return eB[t]||t})}function ej(e,t){if(void 0!==t){try{var n=eS(t);if(e_(e),t){i=n,"#document-fragment"!==i.nodeName&&(n=n.documentElement);for(var i,r,o=(r=n.childNodes,Array.prototype.slice.call(r)),a=0;a<o.length;a++)eh(o[a],e)}}catch(e){throw Error("error parsing SVG: "+e.message)}return e}for(var s=e.firstChild,c=[];s;)!function e(t,n){var i,r,o,a,s;switch(t.nodeType){case 3:n.push(eD(t.textContent,eM));break;case 1:if(n.push("<",t.tagName),t.hasAttributes())for(i=0,r=(o=t.attributes).length;i<r;++i)a=o.item(i),n.push(" ",a.name,'="',eD(a.value,eT),'"');if(t.hasChildNodes()){for(n.push(">"),i=0,r=(s=t.childNodes).length;i<r;++i)e(s.item(i),n);n.push("</",t.tagName,">")}else n.push("/>");break;case 8:n.push("\x3c!--",eD(t.nodeValue,eM),"--\x3e");break;case 4:n.push("<![CDATA[",t.nodeValue,"]]>");break;default:throw Error("unable to handle node "+t.nodeType)}return n}(s,c),s=s.nextSibling;return c.join("")}function eO(e){var t=e.parentNode;return t&&t.removeChild(e),e}function eN(e,t){var n=e.transform.baseVal;if(t){Array.isArray(t)||(t=[t]);var i,r,o,a=t;for(n.clear(),i=0;r=a[i];i++)n.appendItem((o=r)instanceof SVGMatrix?n.createSVGTransformFromMatrix(o):o)}return n.consolidate()}let eL=/^class[ {]/;function e$(e){return Array.isArray(e)}function eI(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function eF(...e){1===e.length&&e$(e[0])&&(e=e[0]);let t=(e=[...e]).pop();return t.$inject=e,t}let ez=/constructor\s*[^(]*\(\s*([^)]*)\)/m,eH=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,eV=/\/\*([^*]*)\*\//m;function eG(e,t){let n,i,r=t||{get:function(e,t){if(o.push(e),!1===t)return null;throw l(`No provider for "${e}"!`)}},o=[],a=this._providers=Object.create(r._providers||null),s=this._instances=Object.create(null),c=s.injector=this,l=function(e){let t=o.join(" -> ");return o.length=0,Error(t?`${e} (Resolving: ${t})`:e)};function p(e,t){if(!a[e]&&e.includes(".")){let t=e.split("."),n=p(t.shift());for(;t.length;)n=n[t.shift()];return n}if(eI(s,e))return s[e];if(eI(a,e)){if(-1!==o.indexOf(e))throw o.push(e),l("Cannot resolve circular dependency!");return o.push(e),s[e]=a[e][0](a[e][1]),o.pop(),s[e]}return r.get(e,t)}function u(e,t){if(void 0===t&&(t={}),"function"!=typeof e)if(e$(e))e=eF(e.slice());else throw l(`Cannot invoke "${e}". Expected a function!`);let n=(e.$inject||function(e){if("function"!=typeof e)throw Error(`Cannot annotate "${e}". Expected a function!`);let t=e.toString().match(eL.test(e.toString())?ez:eH);if(!t)return[];let n=t[1]||t[2];return n&&n.split(",").map(e=>{let t=e.match(eV);return(t&&t[1]||e).trim()})||[]}(e)).map(e=>eI(t,e)?t[e]:p(e));
1return{fn:e,dependencies:n}}function h(e){let{fn:t,dependencies:n}=u(e);return new(Function.prototype.bind.call(t,null,...n))}function d(e,t,n){let{fn:i,dependencies:r}=u(e,n);return i.apply(t,r)}function f(e,t){if(t&&t.length){let n,i,r,o,s=Object.create(null),c=Object.create(null),l=[],p=[],u=[];for(let e in a)n=a[e],-1!==t.indexOf(e)&&("private"===n[2]?-1===(i=l.indexOf(n[3]))?(o=function(e){return eF(t=>e.get(t))}(r=n[3].createChild([],t)),l.push(n[3]),p.push(r),u.push(o),s[e]=[o,e,"private",r]):s[e]=[u[i],e,"private",p[i]]:s[e]=[n[2],n[1]],c[e]=!0),("factory"===n[2]||"type"===n[2])&&n[1].$scope&&t.forEach(t=>{-1!==n[1].$scope.indexOf(t)&&(s[e]=[n[2],n[1]],c[t]=!0)});t.forEach(e=>{if(!c[e])throw Error('No provider for "'+e+'". Cannot use provider from the parent!')}),e.unshift(s)}return new eG(e,c)}let m={factory:d,type:h,value:function(e){return e}};function g(e,t){let n=e.__init__||[];return function(){n.forEach(e=>{"string"==typeof e?t.get(e):t.invoke(e)})}}this.get=p,this.invoke=d,this.instantiate=h,this.createChild=f,this.init=(n=e.reduce(function e(t,n){return -1!==t.indexOf(n)||-1!==(t=(n.__depends__||[]).reduce(e,t)).indexOf(n)?t:t.concat(n)},[]).map(function(e){let t=e.__exports__;if(t){let n=e.__modules__,i=Object.keys(e).reduce((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t),Object.create(null)),r=f((n||[]).concat(i)),o=eF(function(e){return r.get(e)});t.forEach(function(e){a[e]=[o,e,"private",r]});let s=(e.__init__||[]).slice();return s.unshift(function(){r.init()}),g(e=Object.assign({},e,{__init__:s}),r)}return Object.keys(e).forEach(function(t){var n,i;if("__init__"===t||"__depends__"===t)return;let r=e[t];if("private"===r[2]){a[t]=r;return}let o=r[0],s=r[1];a[t]=[m[o],(n=o,i=s,"value"!==n&&e$(i)&&(i=eF(i.slice())),i),o]}),g(e,c)}),i=!1,function(){i||(i=!0,n.forEach(e=>e()))})}function eW(e,t){var n=this;t=t||1e3,e.on(["render.shape","render.connection"],t,function(e,t){var i=e.type,r=t.element,o=t.gfx,a=t.attrs;if(n.canRender(r))if("render.shape"===i)return n.drawShape(o,r,a);else return n.drawConnection(o,r,a)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(e,t){if(n.canRender(t))if("render.getShapePath"===e.type)return n.getShapePath(t);else return n.getConnectionPath(t)})}function eU(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function eq(e){return["L",e.x,e.y]}function eK(e,t,n){let i=t.x-e.x,r=t.y-e.y,o=n/eY(i,r);return{x:e.x+i*o,y:e.y+r*o}}function eY(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function eX(e,t,n){_(t)&&(n=t,t=null),t||(t={});let i=ek("path",t);return _(n)&&(i.dataset.cornerRadius=String(n)),eZ(i,e)}function eZ(e,t){let n=parseInt(e.dataset.cornerRadius,10)||0;return eg(e,{d:eU(function(e,t){var n;let i=e.length,r=[["M",(n=e[0]).x,n.y]];for(let n=1;n<i;n++){let i=e[n-1],o=e[n],a=e[n+1];if(!a||!t){r.push(eq(o));continue}let s=Math.min(t,eY(o.x-i.x,o.y-i.y),eY(a.x-o.x,a.y-o.y));if(!s){r.push(eq(o));continue}let c=eK(o,i,s),l=eK(o,i,.5*s),p=eK(o,a,s),u=eK(o,a,.5*s);
1r.push(eq(c)),r.push(["C",l.x,l.y,u.x,u.y,p.x,p.y])}return r}(t,n))}),e}function eJ(e){var t=new Set(e);return C(e,function(e){for(var n=e.parent;n;){if(t.has(n))return!1;n=n.parent}return!0})}function eQ(e,t,n){n=n||0,v(e)||(e=[e]),R(e,function(e,i){var r=t(e,i,n);v(r)&&r.length&&eQ(r,t,n+1)})}function e0(e,t,n){var i=new Set,r=new Set;return eQ(e,function(e,t,o){i.add(e);var a=e.children;if((-1===n||o<n)&&a&&!r.has(a))return r.add(a),a}),Array.from(i)}function e1(e,t){return e0(e,!0,-1)}function e2(e,t){var n,i,r,o;return t=!!t,v(e)||(e=[e]),R(e,function(e){var a=e;e.waypoints&&!t&&(a=e2(e.waypoints,!0));var s=a.x,c=a.y,l=a.height||0,p=a.width||0;(s<n||void 0===n)&&(n=s),(c<i||void 0===i)&&(i=c),(s+p>r||void 0===r)&&(r=s+p),(c+l>o||void 0===o)&&(o=c+l)}),{x:n,y:i,height:o-i,width:r-n}}function e5(e,t){var n={};return R(e,function(e){var i=e;i.waypoints&&(i=e2(i)),!_(t.y)&&i.x>t.x&&(n[e.id]=e),!_(t.x)&&i.y>t.y&&(n[e.id]=e),i.x>t.x&&i.y>t.y&&(_(t.width)&&_(t.height)&&i.width+i.x<t.width+t.x&&i.height+i.y<t.height+t.y?n[e.id]=e:_(t.width)&&_(t.height)||(n[e.id]=e))}),n}function e3(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function e6(e){return!!(e&&e.isFrame)}function e9(e,t){return G({},e||{},t||{})}function e4(e,t){eW.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})}function e8(e,t){if(!e||!t)return -1;var n=e.indexOf(t);return -1!==n&&e.splice(n,1),n}function e7(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i)if(i===n)return;else{if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function te(e,t){return e&&t?e.indexOf(t):-1}function tt(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function tn(e,t,n,i){return void 0===i&&(i=5),!!e&&!!t&&!!n&&Math.abs(((t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x))/tt(e,t))<=i}function ti(e,t){var n=Array.from(arguments).flat();for(let[e,t]of Object.entries({x:"v",y:"h"}))if(function(e,t){let n=t[0];return A(t,function(t){return 2>=Math.abs(n[e]-t[e])})}(e,n))return t;return!1}function tr(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function to(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}eW.prototype.canRender=function(e){},eW.prototype.drawShape=function(e,t){},eW.prototype.drawConnection=function(e,t){},eW.prototype.getShapePath=function(e){},eW.prototype.getConnectionPath=function(e){},i(e4,eW),e4.prototype.canRender=function(){return!0},e4.prototype.drawShape=function(e,t,n){var i=ek("rect");return eg(i,{x:0,y:0,width:t.width||0,height:t.height||0}),e6(t)?eg(i,G({},this.FRAME_STYLE,n||{})):eg(i,G({},this.SHAPE_STYLE,n||{})),ed(e,i),i},e4.prototype.drawConnection=function(e,t,n){var i=eX(t.waypoints,G({},this.CONNECTION_STYLE,n||{}));return ed(e,i),i},e4.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return eU([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},e4.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 eU(r)},e4.$inject=["eventBus","styles"];var ta=/,?([a-z]),?/gi,ts=parseFloat,tc=Math,tl=tc.PI,tp=tc.min,tu=tc.max,th=tc.pow,td=tc.abs,tf=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/ig,tm=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/ig,tg=Array.isArray||function(e){return e instanceof Array};function ty(e,t,n,i){return 1==arguments.length&&(t=e.y,n=e.width,i=e.height,e=e.x),{x:e,y:t,width:n,height:i,x2:e+n,y2:t+i}}function tv(){return this.join(",").replace(ta,"$1")}function tb(e,t,n,i,r,o,a,s,c){var l=1-c,p=th(l,3),u=th(l,2),h=c*c*c,d=p*e+3*u*c*n+3*l*c*c*r+h*a,f=p*t+3*u*c*i+3*l*c*c*o+h*s;return{x:tS(d),y:tS(f)}}function t_(e){var t=function(e,t,n,i,r,o,a,s){for(var c,l,p,u,h,d,f,m,g=[],y=[[],[]],v=0;v<2;++v){if(0==v?(l=6*e-12*n+6*r,c=-3*e+9*n-9*r+3*a,p=3*n-3*e):(l=6*t-12*i+6*o,c=-3*t+9*i-9*o+3*s,p=3*i-3*t),1e-12>
1td(c)){if(1e-12>td(l))continue;0<(u=-p/l)&&u<1&&g.push(u);continue}f=l*l-4*p*c,m=tc.sqrt(f),!(f<0)&&(0<(h=(-l+m)/(2*c))&&h<1&&g.push(h),0<(d=(-l-m)/(2*c))&&d<1&&g.push(d))}for(var b,_=g.length,x=_;_--;)b=1-(u=g[_]),y[0][_]=b*b*b*e+3*b*b*u*n+3*b*u*u*r+u*u*u*a,y[1][_]=b*b*b*t+3*b*b*u*i+3*b*u*u*o+u*u*u*s;return y[0][x]=e,y[1][x]=t,y[0][x+1]=a,y[1][x+1]=s,y[0].length=y[1].length=x+2,{x0:tp(...y[0]),y0:tp(...y[1]),x1:tu(...y[0]),y1:tu(...y[1])}}(...e);return ty(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function tx(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function tw(e,t,n,i,r){var o=e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i;return e*o-3*t+3*n}function tE(e,t,n,i,r,o,a,s,c){null==c&&(c=1);for(var l=(c=c>1?1:c<0?0:c)/2,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],u=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,d=0;d<12;d++){var f=l*p[d]+l,m=tw(f,e,n,r,a),g=tw(f,t,i,o,s),y=m*m+g*g;h+=u[d]*tc.sqrt(y)}return l*h}function tS(e){return Math.round(1e11*e)/1e11}function tk(e,t,n){e=tP(e),t=tP(t);for(var i,r,o,a,s,c,l,p,u,h,d=n?0:[],f=0,m=e.length;f<m;f++){var g=e[f];if("M"==g[0])i=s=g[1],r=c=g[2];else{"C"==g[0]?(i=(u=[i,r,...g.slice(1)])[6],r=u[7]):(u=[i,r,i,r,s,c,s,c],i=s,r=c);for(var y=0,v=t.length;y<v;y++){var b=t[y];if("M"==b[0])o=l=b[1],a=p=b[2];else{"C"==b[0]?(o=(h=[o,a,...b.slice(1)])[6],a=h[7]):(h=[o,a,o,a,l,p,l,p],o=l,a=p);var _=function(e,t,n){var i=t_(e),r=t_(t);if(o=i,a=r,o=ty(o),!(tx(a=ty(a),o.x,o.y)||tx(a,o.x2,o.y)||tx(a,o.x,o.y2)||tx(a,o.x2,o.y2)||tx(o,a.x,a.y)||tx(o,a.x2,a.y)||tx(o,a.x,a.y2)||tx(o,a.x2,a.y2))&&((!(o.x<a.x2)||!(o.x>a.x))&&(!(a.x<o.x2)||!(a.x>o.x))||(!(o.y<a.y2)||!(o.y>a.y))&&(!(a.y<o.y2)||!(a.y>o.y))))return n?0:[];var o,a,s,c,l=tE(...e),p=tE(...t),u=tC(e)?1:~~(l/5)||1,h=tC(t)?1:~~(p/5)||1,d=Array(u+1),f=Array(h+1),m={},g=n?0:[];for(s=0;s<u+1;s++){var y=tb(...e,s/u);d[s]={x:y.x,y:y.y,t:s/u}}for(s=0;s<h+1;s++)y=tb(...t,s/h),f[s]={x:y.x,y:y.y,t:s/h};for(s=0;s<u;s++)for(c=0;c<h;c++){var v,b=d[s],_=d[s+1],x=f[c],w=f[c+1],E=.01>td(_.x-b.x)?"y":"x",S=.01>td(w.x-x.x)?"y":"x",k=function(e,t,n,i,r,o,a,s){if(!(tu(e,n)<tp(r,a)||tp(e,n)>tu(r,a)||tu(t,i)<tp(o,s)||tp(t,i)>tu(o,s))){var c=(e*i-t*n)*(r-a)-(e-n)*(r*s-o*a),l=(e*i-t*n)*(o-s)-(t-i)*(r*s-o*a),p=(e-n)*(o-s)-(t-i)*(r-a);if(p){var u=tS(c/p),h=tS(l/p),d=+u.toFixed(2),f=+h.toFixed(2);if(!(d<+tp(e,n).toFixed(2)||d>+tu(e,n).toFixed(2)||d<+tp(r,a).toFixed(2)||d>+tu(r,a).toFixed(2)||f<+tp(t,i).toFixed(2)||f>+tu(t,i).toFixed(2)||f<+tp(o,s).toFixed(2)||f>+tu(o,s).toFixed(2)))return{x:u,y:h}}}}(b.x,b.y,_.x,_.y,x.x,x.y,w.x,w.y);if(k){if(m[v=k.x.toFixed(9)+"#"+k.y.toFixed(9)])continue;m[v]=!0;var C=b.t+td((k[E]-b[E])/(_[E]-b[E]))*(_.t-b.t),R=x.t+td((k[S]-x[S])/(w[S]-x[S]))*(w.t-x.t);C>=0&&C<=1&&R>=0&&R<=1&&(n?g++:g.push({x:k.x,y:k.y,t1:C,t2:R}))}}return g}(u,h,n);if(n)d+=_;else{for(var x=0,w=_.length;x<w;x++)_[x].segment1=f,_[x].segment2=y,_[x].bez1=u,_[x].bez2=h;d=d.concat(_)}}}}}return d}function tC(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function tR(e,t,n,i,r,o){return[1/3*e+2/3*n,1/3*t+2/3*i,1/3*r+2/3*n,1/3*o+2/3*i,r,o]}function tP(e){if(tg(t=e)&&tg(t[0])||(e=function(e){if(!e)return null;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},n=[];return String(e).replace(tf,function(e,i,r){var o=[],a=i.toLowerCase();for(r.replace(tm,function(e,t){t&&o.push(+t)}),"m"==a&&o.length>2&&(n.push([i,...o.splice(0,2)]),a="l",i="m"==i?"l":"L");o.length>=t[a]&&(n.push([i,...o.splice(0,t[a])]),t[a]););}),n.toString=tv,n}(e)),function(e){for(var t=0,n=e.length;t<n;t++){var i=e[t][0];if("M"!==i&&"C"!==i)return!1}return!0}(e))return e;for(var t,n=function(e){for(var t=Array(e.length),n=0,i=e.length;n<i;n++)for(var r=e[n],o=t[n]=Array(r.length),a=0,s=r.length;a<s;a++)o[a]=r[a];return t.toString=tv,t}(function(e){if(function(e){for(var t=0,n=e.length;t<n;t++){var i=e[t][0];if("string"==typeof i&&i!==i.toUpperCase())return!1}return!0}(e))return e;var t,n=Array(e.length),i=0,r=0,o=0,a=0,s=0;"M"==e[0][0]&&(i=+e[0][1],r=+e[0][2],o=i,a=r,s++,n[0]=["M",i,r]);for(var c,l,p=s,u=e.length;p<u;p++){if(t=(l=e[p])[0],n[p]=c=Array(l.length),t!=t.toUpperCase())switch(c[0]=t.toUpperCase(),c[0]){case"A":c[1]=l[1],c[2]=l[2],c[3]=l[3],c[4]=l[4],c[5]=l[5],c[6]=+l[6]+i,c[7]=+l[7]+r;break;case"V":c[1]=+l[1]+r;break;case"H":c[1]=+l[1]+i;break;case"M":o=+l[1]+i,a=+l[2]+r;default:for(var h=1,d=l.length;h<d;h++)c[h]=+l[h]+(h%2?i:r)}else for(var f=0,m=l.length;f<m;f++)c[f]=l[f];switch(t=t.toUpperCase(),c[0]){case"Z":i=+o,r=+a;break;case"H":i=c[1];break;case"V":r=c[1];break;case"M":o=c[c.length-2],a=c[c.length-1];default:i=c[c.length-2],r=c[c.length-1]}}return n.toString=tv,n}(e)),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=[],o="",a="",s=0,c=n.length;s<c;s++){n[s]&&(o=n[s][0]),"C"!=o&&(r[s]=o,s&&(a=r[s-1])),n[s]=function(e,t,n){var i,r,o,a,s,c,l,p,u,h,d,f,m,g,y,v,b,_;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(e[0]in{T:1,Q:1}||(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C",...function e(t,n,i,r,o,a,s,c,l,p){var u,h=120*tl/180,d=tl/180*(+o||0),f=[],m=function(e){function t(){var n=Array.prototype.slice.call(arguments,0),i=n.join("â"),r=t.cache=t.cache||{},o=t.count=t.count||[];return Object.prototype.hasOwnProperty.call(r,i)?!function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}(o,i):(o.length>=1e3&&delete r[o.shift()],o.push(i),r[i]=e(...arguments)),r[i]}return t}(function(e,t,n){return{x:e*tc.cos(n)-t*tc.sin(n),y:e*tc.sin(n)+t*tc.cos(n)}});if(p)S=p[0],k=p[1],w=p[2],E=p[3];else{t=(u=m(t,n,-d)).x,n=u.y,c=(u=m(c,l,-d)).x,l=u.y;var g=(t-c)/2,y=(n-l)/2,v=g*g/(i*i)+y*y/(r*r);v>1&&(i*=v=tc.sqrt(v),r*=v);var b=i*i,_=r*r,x=(a==s?-1:1)*tc.sqrt(td((b*_-b*y*y-_*g*g)/(b*y*y+_*g*g))),w=x*i*y/r+(t+c)/2,E=-(x*r)*g/i+(n+l)/2,S=tc.asin(((n-E)/r).toFixed(9)),k=tc.asin(((l-E)/r).toFixed(9));S=t<w?tl-S:S,k=c<w?tl-k:k,S<0&&(S=2*tl+S),k<0&&(k=2*tl+k),s&&S>k&&(S-=2*tl),!s&&k>S&&(k-=2*tl)}var C=k-S;if(td(C)>h){var R=k,P=c,A=l;k=S+h*(s&&k>S?1:-1),f=e(c=w+i*tc.cos(k),l=E+r*tc.sin(k),i,r,o,0,s,P,A,[k,R,w,E])}C=k-S;var M=tc.cos(S),T=tc.sin(S),B=tc.cos(k),D=tc.sin(k),j=tc.tan(C/4),O=4/3*i*j,N=4/3*r*j,L=[t,n],$=[t+O*T,n-N*M],I=[c+O*D,l-N*B],F=[c,l];if($[0]=2*L[0]-$[0],$[1]=2*L[1]-$[1],p)return[$,I,F].concat(f);f=[$,I,F].concat(f).join().split(",");for(var z=[],H=0,V=f.length;H<V;H++)z[H]=H%2?m(f[H-1],f[H],d).y:m(f[H],f[H+1],d).x;return z}(t.x,t.y,...e.slice(1))];break;case"S":"C"==n||"S"==n?(i=2*t.x-t.bx,r=2*t.y-t.by):(i=t.x,r=t.y),e=["C",i,r,...e.slice(1)];break;case"T":"Q"==n||"T"==n?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C",...tR(t.x,t.y,t.qx,t.qy,e[1],e[2])];break;case"Q":t.qx=e[1],t.qy=e[2],e=["C",...tR(t.x,t.y,e[1],e[2],e[3],e[4])];break;case"L":e=["C",...(o=t.x,a=t.y,[o,a,s=e[1],c=e[2],s,c])];break;case"H":e=["C",...(l=t.x,p=t.y,[l,p,u=e[1],h=t.y,u,h])];break;case"V":e=["C",...(d=t.x,f=t.y,[d,f,m=t.x,g=e[1],m,g])];break;case"Z":e=["C",...(y=t.x,v=t.y,[y,v,b=t.X,_=t.Y,b,_])]}return e}(n[s],i,a),"A"!=r[s]&&"C"==o&&(r[s]="C"),function(e,t){if(e[t].length>7){e[t].shift();for(var i=e[t];i.length;)r[t]="A",e.splice(t++,0,["C",...i.splice(0,6)]);e.splice(t,1),c=n.length}}(n,s);var l=n[s],p=l.length;i.x=l[p-2],i.y=l[p-1],i.bx=ts(l[p-4])||i.x,i.by=ts(l[p-3])||i.y}return n}function tA(e){return b(e)&&E(e,"waypoints")}function tM(e){return b(e)&&E(e,"labelTarget")}function tT(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function tB(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function tD(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.he
1ight||0),left:e.x}}function tj(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function tO(e){return tA(e)?function(e){for(var t=e.waypoints,n=t.reduce(function(e,n,i){var r=t[i-1];if(r){var o,a,s=e[e.length-1],c=s&&s.endLength||0,l=(o=r,a=n,Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2)));e.push({start:r,end:n,startLength:c,endLength:c+l,length:l})}return e},[]),i=n.reduce(function(e,t){return e+t.length},0)/2,r=0,o=n[0];o.endLength<i;)o=n[++r];var a=(i-o.startLength)/o.length;return{x:o.start.x+(o.end.x-o.start.x)*a,y:o.start.y+(o.end.y-o.start.y)*a}}(e):tB({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function tN(e,t,n){b(n=n||0)||(n={x:n,y:n});var i=tD(e),r=tD(t),o=i.bottom+n.y<=r.top,a=i.left-n.x>=r.right,s=i.top-n.y>=r.bottom,c=i.right+n.x<=r.left,l=o?"top":s?"bottom":null,p=c?"left":a?"right":null;return p&&l?l+"-"+p:p||l||"intersect"}function tL(e,t,n){var i=tk(e,t);return 1===i.length||2===i.length&&1>tt(i[0],i[1])?tB(i[0]):i.length>1?tB((i=N(i,function(e){var t=Math.floor(100*e.t2)||1;return t=((t=100-t)<10?"0":"")+t,e.segment2+"#"+t}))[n?0:i.length-1]):null}function t$(e,t){return Math.round(e*t)/t}function tI(e){return _(e)?e+"px":e}function tF(e,t,n){let i=ek("g");ev(i).add(t);let r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}let tz={shape:["x","y","width","height"],connection:["waypoints"]};function tH(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}function tV(e,t){let n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}tH.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],tH.prototype._init=function(e){var t;let n,i,r=this._eventBus,o=this._container=(n=(t=G({},{width:"100%",height:"100%"},t=e)).container||document.body,(i=document.createElement("div")).setAttribute("class","djs-container djs-parent bio-theme-parent"),q(i,{position:"relative",overflow:"hidden",width:tI(t.width),height:tI(t.height)}),n.appendChild(i),i),a=this._svg=ek("svg");eg(a,{width:"100%",height:"100%"}),K(a,"tabindex",0),e.autoFocus&&r.on("element.hover",()=>{this.restoreFocus()}),r.on("element.mousedown",500,e=>{this.focus()}),a.addEventListener("focusin",()=>{this._setFocused(!0)}),a.addEventListener("focusout",()=>{this._setFocused(!1)}),a.addEventListener("mouseover",()=>{this._eventBus.fire("canvas.mouseover")}),a.addEventListener("mouseout",()=>{this._eventBus.fire("canvas.mouseout")}),ed(o,a);let s=this._viewport=tF(a,"viewport");e.deferUpdate&&(this._viewboxChanged=H(this._viewboxChanged,300)),this._restoreFocus=H(this._restoreFocus,0),r.on("diagram.init",()=>{r.fire("canvas.init",{svg:a,viewport:s})}),r.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),r.on("diagram.destroy",500,this._destroy,this),r.on("diagram.clear",500,this._clear,this)},tH.prototype._destroy=function(){this._restoreFocus.cancel(),this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});let 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},tH.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))},tH.prototype._clear=function(){this._elementRegistry.getAll().forEach(e=>{let t=e3(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},tH.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},tH.prototype.restoreFocus=function(){this._restoreFocus()},tH.prototype._restoreFocus=function(){document.activeElement===document.body&&this.focus()},tH.prototype.isFocused=function(){return this._focused},tH.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},tH.prototype.getLayer=function(e,t){if(!e)throw 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 Error("layer <"+e+"> already created at index <"+t+">");return n.group},tH.prototype._getChildIndex=function(e){return P(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)},tH.prototype._createLayer=function(e,t){void 0===t&&(t=1);let n=this._getChildIndex(t);return{group:tF(this._viewport,"layer-"+e,n),index:t,visible:!0}},tH.prototype.showLayer=function(e){if(!e)throw Error("must specify a name");let t=this._layers[e];if(!t)throw Error("layer <"+e+"> does not exist");let n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;let o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},tH.prototype.hideLayer=function(e){if(!e)throw Error("must specify a name");let t=this._layers[e];if(!t)throw Error("layer <"+e+"> does not exist");let n=t.group;return t.visible&&(eO(n),t.visible=!1),n},tH.prototype._removeLayer=function(e){let t=this._layers[e];t&&(delete this._layers[e],eO(t.group))},tH.prototype.getActiveLayer=function(){let e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},tH.prototype.findRoot=function(e){let t;for(let n of this._resolveElements(e)){let e=this._findPlaneForRoot(function(e){for(;e.parent;)e=e.parent;return e}(n));if(!e||t&&e.rootElement!==t)return;t=e.rootElement}return t},tH.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},tH.prototype._findPlaneForRoot=function(e){return S(this._planes,function(t){return t.rootElement===e})},tH.prototype._resolveElement=function(e){return"string"==typeof e?this._elementRegistry.get(e):e},tH.prototype._resolveElements=function(e){return v(e)||(e=[e]),e.map(e=>
1this._resolveElement(e)).filter(Boolean)},tH.prototype.getContainer=function(){return this._container},tH.prototype._updateMarker=function(e,t,n){let i;(e=this._resolveElement(e)).markers=e.markers||new Set,(i=this._elementRegistry._elements[e.id])&&(R([i.gfx,i.secondaryGfx],function(i){i&&(n?(e.markers.add(t),ev(i).add(t)):(e.markers.delete(t),ev(i).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},tH.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},tH.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},tH.prototype.hasMarker=function(e,t){return!!(e=this._resolveElement(e)).markers&&e.markers.has(t)},tH.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},tH.prototype.getRootElement=function(){let e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},tH.prototype.addRootElement=function(e){let t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});let n=e.layer="root-"+t;this._ensureValid("root",e);let i=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},tH.prototype.removeRootElement=function(e){if(e=this._resolveElement(e),this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(t){return t.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e},tH.prototype.setRootElement=function(e){if(e===this._rootElement)return e;if(!e)throw Error("rootElement required");return this._findPlaneForRoot(e)||(e=this.addRootElement(e)),this._setRoot(e),e},tH.prototype._removeRoot=function(e){let t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},tH.prototype._addRoot=function(e,t){let n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},tH.prototype._setRoot=function(e,t){let 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})},tH.prototype._ensureValid=function(e,t){if(!t.id)throw Error("element must have an id");if(this._elementRegistry.get(t.id))throw Error("element <"+t.id+"> already exists");let n=tz[e];if(!A(n,function(e){return void 0!==t[e]}))throw Error("must supply { "+n.join(", ")+" } with "+e)},tH.prototype._setParent=function(e,t,n){e7(t.children,e,n),e.parent=t},tH.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();let r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);let 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},tH.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},tH.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},tH.prototype._removeElement=function(e,t){let 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),e8(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},tH.prototype.removeShape=function(e){return this._removeElement(e,"shape")},tH.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},tH.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},tH.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},tH.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},tH.prototype.viewbox=function(e){let t,n,i,r,o,a,s;if(void 0===e&&this._cachedViewbox)return structuredClone(this._cachedViewbox);let c=this._viewport,l=this.getSize();return e?this._changeViewbox(function(){o=Math.min(l.width/e.width,l.height/e.he
1ight),eN(c,this._svg.createSVGMatrix().scale(o).translate(-e.x,-e.y))}):(t=(i=this._rootElement?this.getActiveLayer():null)&&i.getBBox()||{},o=t$((n=(r=eN(c))?r.matrix:function(e,t,n,i,r,o){var a=eR().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return eP(a,e);case 6:return eP(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}()).a,1e3),a=t$(-n.e||0,1e3),s=t$(-n.f||0,1e3),e=this._cachedViewbox={x:a?a/o:0,y:s?s/o:0,width:l.width/o,height:l.height/o,scale:o,inner:{width:t.width||0,height:t.height||0,x:t.x||0,y:t.y||0},outer:l}),e},tH.prototype.scroll=function(e){let t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=G({dx:0,dy:0},e||{}),tV(t,n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n))}),{x:n.e,y:n.f}},tH.prototype.scrollToElement=function(e,t){let n,i,r=100,o=this._resolveElements(e);if(!o.length)return;let a=this.findRoot(o);if(!a)return;a!==this.getRootElement()&&this.setRootElement(a);let s=o.filter(e=>e!=a);if(!s.length)return;t||(t={}),"number"==typeof t&&(r=t),t={top:t.top||r,right:t.right||r,bottom:t.bottom||r,left:t.left||r};let c=e2(s),l=tD(c),p=this.viewbox(),u=this.zoom();p.y+=t.top/u,p.x+=t.left/u,p.width-=(t.right+t.left)/u,p.height-=(t.bottom+t.top)/u;let h=tD(p);if(c.width<p.width&&c.height<p.height){let e=Math.max(0,l.right-h.right),t=Math.min(0,l.left-h.left),r=Math.max(0,l.bottom-h.bottom),o=Math.min(0,l.top-h.top);n=e||t,i=r||o}else n=c.x-p.x,i=c.y-p.y;this.scroll({dx:-n*u,dy:-i*u})},tH.prototype.zoom=function(e,t){let n,i;return e?"fit-viewport"===e?this._fitViewport(t):(this._changeViewbox(function(){"object"!=typeof t&&(t={x:(n=this.viewbox().outer).width/2,y:n.height/2}),i=this._setZoom(e,t)}),t$(i.a,1e3)):this.viewbox(e).scale},tH.prototype._fitViewport=function(e){let t,n,i=this.viewbox(),r=i.outer,o=i.inner;return o.x>=0&&o.y>=0&&o.x+o.width<=r.width&&o.y+o.height<=r.height&&!e?n={x:0,y:0,width:Math.max(o.width+o.x,r.width),height:Math.max(o.height+o.y,r.height)}:(t=Math.min(1,r.width/o.width,r.height/o.height),n={x:o.x+(e?o.width/2-r.width/t/2:0),y:o.y+(e?o.height/2-r.height/t/2:0),width:r.width/t,height:r.height/t}),this.viewbox(n),this.viewbox(!1).scale},tH.prototype._setZoom=function(e,t){let n,i,r,o,a=this._svg,s=this._viewport,c=a.createSVGMatrix(),l=a.createSVGPoint(),p=(i=s.getCTM()).a;return t?(n=G(l,t).matrixTransform(i.inverse()),r=c.translate(n.x,n.y).scale(1/p*e).translate(-n.x,-n.y),o=i.multiply(r)):o=c.scale(e),tV(this._viewport,o),o},tH.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},tH.prototype.getAbsoluteBBox=function(e){let t,n=this.viewbox();return{x:(t=e.waypoints?this.getGraphics(e).getBBox():e).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}},tH.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var tG="data-element-id";function tW(e){this._elements={},this._eventBus=e}function tU(e,t,n){var i,r,o=(i=n[t.name]||[],r=t.inverse,Object.defineProperty(i,"remove",{value:function(t){var i=this.indexOf(t);return -1!==i&&(this.splice(i,1),e.unset(t,r,n)),t}}),Object.defineProperty(i,"contains",{value:function(e){return -1!==this.indexOf(e)}}),Object.defineProperty(i,"add",{value:function(t,i){var o=this.indexOf(t);if(void 0===i){if(-1!==o)return;i=this.length}-1!==o&&this.splice(o,1),this.splice(i,0,t),-1===o&&e.set(t,r,n)}}),Object.defineProperty(i,"__refs_collection",{value:!0}),i);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:o}),o.length&&o.forEach(function(i){e.set(i,t.inverse,n)})}function tq(e,t){if(!(this instanceof tq))return new tq(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}tW.$inject=["eventBus"],tW.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),eg(t,tG,i),n&&eg(n,tG,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},tW.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(eg(i.gfx,tG,""),i.secondaryGfx&&eg(i.secondaryGfx,tG,""),delete t[n])}
1,tW.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)},tW.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&eg(t,tG,i),t},tW.prototype.get=function(e){var t="string"==typeof e?e:e&&eg(e,tG),n=this._elements[t];return n&&n.element},tW.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},tW.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],o=r.element;if(e(o,r.gfx))return o}},tW.prototype.getAll=function(){return this.filter(function(e){return e})},tW.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var i=t[n];return e(i.element,i.gfx)})},tW.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},tW.prototype._validateId=function(e){if(!e)throw Error("element must have an id");if(this._elements[e])throw Error("element with id "+e+" already added")},tq.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw Error("no property <"+t+"> in ref");t=this.props[t]}if(t.collection)tU(this,t,e);else{var n,i,r,o;n=this,r=(i=t).inverse,o=e[i.name],Object.defineProperty(e,i.name,{configurable:i.configurable,enumerable:i.enumerable,get:function(){return o},set:function(t){if(t!==o){var i=o;o=null,i&&n.unset(i,r,e),o=t,n.set(o,r,e)}}})}},tq.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return!0!==n.__refs_collection&&tU(this,t,e),n},tq.prototype.ensureBound=function(e,t){Object.prototype.hasOwnProperty.call(e,t.name||t)||this.bind(e,t)},tq.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},tq.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var tK=new tq({name:"children",enumerable:!0,collection:!0}
1,{name:"parent"}),tY=new tq({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),tX=new tq({name:"attachers",collection:!0},{name:"host"}),tZ=new tq({name:"outgoing",collection:!0},{name:"source"}),tJ=new tq({name:"incoming",collection:!0},{name:"target"});function tQ(){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)}}),tK.bind(this,"parent"),tY.bind(this,"labels"),tZ.bind(this,"outgoing"),tJ.bind(this,"incoming")}function t0(){tQ.call(this),tK.bind(this,"children"),tX.bind(this,"host"),tX.bind(this,"attachers")}function t1(){tQ.call(this),tK.bind(this,"children")}function t2(){t0.call(this),tY.bind(this,"labelTarget")}function t5(){tQ.call(this),tZ.bind(this,"source"),tJ.bind(this,"target")}i(t0,tQ),i(t1,t0),i(t2,t0),i(t5,tQ);var t3={connection:t5,shape:t0,label:t2,root:t1};function t6(){this._uid=12}t6.prototype.createRoot=function(e){return this.create("root",e)},t6.prototype.createLabel=function(e){return this.create("label",e)},t6.prototype.createShape=function(e){return this.create("shape",e)},t6.prototype.createConnection=function(e){return this.create("connection",e)},t6.prototype.create=function(e,t){(t=G({},t||{})).id||(t.id=e+"_"+this._uid++);var n=t,i=t3[e];if(!i)throw Error("unknown type: <"+e+">");return G(new i,n)};var t9="__fn",t4=Array.prototype.slice;function t8(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function t7(){}function ne(e){return e.childNodes[0]}function nt(e,t,n,i,r){var o=eA();o.setTranslate(t,n);var a=eA();a.setRotate(i||0,0,0);var s=eA();s.setScale(r||1,r||1),eN(e,[o,a,s])}function nn(e,t,n){var i=eA();i.setTranslate(t,n),eN(e,i)}function ni(e,t){var n=eA();n.setRotate(t,0,0),eN(e,n)}function nr(e,t){this._eventBus=e,this._elementRegistry=t}t8.prototype.on=function(e,t,n,i){if(e=v(e)?e:[e],x(t)&&(i=n,n=t,t=1e3),!_(t))throw Error("priority must be a number");var r=n;i&&((r=V(n,i))[t9]=n[t9]||n);var o=this;e.forEach(function(e){o._addListener(e,{priority:t,callback:r,next:null})})},t8.prototype.once=function(e,t,n,i){var r=this;if(x(t)&&(i=n,n=t,t=1e3),!_(t))throw Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o[t9]=n,this.on(e,t,o)},t8.prototype.off=function(e,t){e=v(e)?e:[e];var n=this;e.forEach(function(e){n._removeListener(e,t)})},t8.prototype.createEvent=function(e){var t=new t7;return t.init(e),t},t8.prototype.fire=function(e,t){if(o=t4.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw Error("no event type specified");if(i=this._listeners[e]){n=t instanceof t7?t:this.createEvent(t),o[0]=n;var n,i,r,o,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}},t8.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},t8.prototype._destroy=function(){this._listeners={}},t8.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},t8.prototype._invokeListener=function(e,t,n){var i,r,o;if(n.callback.__isTomb)return i;try{r=n.callback,o=t,i=r.apply(null,o),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},t8.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(!i)return void this._setListeners(e,t);for(;i;){if(i.priority<t.priority){t.next=i,n?n.next=t:this._setListeners(e,t);return}n=i,i=i.next}n.next=t},t8.prototype._getListeners=function(e){return this._listeners[e]},t8.prototype._setListeners=function(e,t){this._listeners[e]=t},t8.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(!t)return void this._setListeners(e,null);for(;o;)n=o.next,((r=o.callback)===t||r[t9]===t)&&(i?i.next=n:this._setListeners(e,n)),i=o,o=n},t7.prototype.stopPropagation=function(){this.cancelBubble=!0},t7.prototype.preventDefault=function(){this.defaultPrevented=!0},t7.prototype.init=function(e){G(this,e||{})},nr.$inject=["eventBus","elementRegistry"],nr.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=n.parentNode.childNodes[1])||(ev(t=ek("g")).add("djs-children"),ed(n.parentNode,t)):t=n,t},nr.prototype._clear=function(e){var t=ne(e);return J(t),t},nr.prototype._createContainer=function(e,t,n,i){var r,o,a,s=ek("g");ev(s).add("djs-group"),void 0!==n?(r=s,o=t,r!==(a=t.childNodes[n]||o.firstChild)&&o.insertBefore(r,a)):ed(t,s);var c=ek("g");ev(c).add("djs-element"),ev(c).add("djs-"+e),i&&ev(c).add("djs-frame"),ed(s,c);var l=ek("g");return ev(l).add("djs-visual"),ed(c,l),c},nr.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,e6(t))},nr.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry;R(P(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),function(e){var i=e.children;if(i){var r=t._getChildrenContainer(e),o=r.firstChild;R(i,function(e){var t=n.getGraphics(e).parentNode;
1t===o?o=o.nextSibling:r.insertBefore(t,o)})}})},nr.prototype.drawShape=function(e,t,n={}){return this._eventBus.fire("render.shape",{gfx:e,element:t,attrs:n})},nr.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},nr.prototype.drawConnection=function(e,t,n={}){return this._eventBus.fire("render.connection",{gfx:e,element:t,attrs:n})},nr.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},nr.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),nn(n,t.x,t.y);else if("connection"===e)this.drawConnection(i,t);else throw Error("unknown type: "+e);t.hidden?eg(n,"display","none"):eg(n,"display","block")}},nr.prototype.remove=function(e){eO(this._elementRegistry.getGraphics(e).parentNode)};let no={__depends__:[{__init__:["defaultRenderer"],defaultRenderer:["type",e4],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 G(this.style(t,n),{class:e})},this.style=function(t,n){v(t)||n||(n=t,t=[]);var i=P(t,function(t,n){return G(t,e[n]||{})},{});return n?G(i,n):i},this.computeStyle=function(e,n,i){return v(n)||(i=n,n=[]),t.style(n||[],G({},i,e||{}))}}]}],__init__:["canvas"],canvas:["type",tH],elementRegistry:["type",tW],elementFactory:["type",t6],eventBus:["type",t8],graphicsFactory:["type",nr]};function na(e,t){var n,i;this._injector=t||((i=new eG([{config:["value",n=(n=e)||{}]},no].concat(n.modules||[]))).init(),i),this.get("eventBus").fire("diagram.init")}function ns(){}function nc(e,t){this.model=e,this.properties=t}na.prototype.get=function(e,t){return this._injector.get(e,t)},na.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},na.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},na.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},ns.prototype.get=function(e){return this.$model.properties.get(this,e)},ns.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},nc.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(ns.prototype);R(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 o(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),R(e,V(function(e,t){this.set(t,e)},this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o}
1;var nl=G(Object.create(null),{String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0}),np=G(Object.create(null),{String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}});function nu(e,t){var n=np[e];return n?n(t):t}function nh(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else if(2===r.length)n=r[1],i=r[0];else throw Error("expected <prefix:localName> or <localName>, got "+e);return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function nd(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName=Object.create(null),this.properties=[],this.propertiesByName=Object.create(null)}function nf(e,t){this.packageMap=Object.create(null),this.typeMap=Object.create(null),this.packages=[],this.properties=t,R(e,V(this.registerPackage,this))}function nm(e,t,n){var i=t[n];if(i in e)throw Error("package with "+n+" <"+i+"> already defined")}function ng(e){this.model=e}function ny(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function nv(e){return e.replace(/^:/,"")}function nb(e,t={}){this.properties=new ng(this),this.factory=new nc(this,this.properties),this.registry=new nf(e,this.properties),this.typeCache=Object.create(null),this.config=t}nd.prototype.build=function(){return W(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},nd.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)},nd.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 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 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 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},nd.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=nh(r[0],i),a=nh(r[1],o.prefix).name,s=this.propertiesByName[a];if(s)this.replaceProperty(s,e,n);else throw Error("refined property <"+a+"> not found");delete e.redefines},nd.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},nd.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},nd.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},nd.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},nd.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw Error(`cannot create <${e.name}> extending <${e.extends}>`)},nd.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw 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")},nd.prototype.hasProperty=function(e){return this.propertiesByName[e]},nd.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(R(e.properties,V(function(n){Object.defineProperty(n=G({},n,{name:n.ns.localName,inherited:t}),"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)},nf.prototype.getPackage=function(e){return this.packageMap[e]},nf.prototype.getPackages=function(){return this.packages},nf.prototype.registerPackage=function(e){e=G({},e);var t=this.packageMap;nm(t,e,"prefix"),nm(t,e,"uri"),R(e.types,V(function(t){this.registerType(t,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},nf.prototype.registerType=function(e,t){var n=nh((e=G({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:G({},e.meta||{})})).name,t.prefix),i=n.name,r=Object.create(null);R(e.properties,V(function(e){var t=nh(e.name,n.prefix),i=t.name;nl[e.type]||(e.type=nh(e.type,t.prefix).name),G(e,{ns:t,name:i}),r[i]=e},this)),G(e,{ns:n,name:i,propertiesByName:r}
1),R(e.extends,V(function(e){var t=nh(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},nf.prototype.mapTypes=function(e,t,n){var i=nl[e.name]?{name:e.name}:this.typeMap[e.name],r=this;function o(n,i){var o=nh(n,nl[n]?"":e.prefix);r.mapTypes(o,t,i)}function a(e){return o(e,!0)}if(!i)throw Error("unknown type <"+e.name+">");R(i.superClass,n?a:function(e){return o(e,!1)}),t(i,!n),R(i.traits,a)},nf.prototype.getEffectiveDescriptor=function(e){var t=nh(e),n=new nd(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},nf.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},ng.prototype.set=function(e,t,n){if(!w(t)||!t.length)throw 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[nv(t)]:i?r in e?e[r]=n:ny(e,i,n):e.$attrs[nv(t)]=n},ng.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[nv(t)];var i=n.name;return!e[i]&&n.isMany&&ny(e,n,[]),e[i]},ng.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;n=G({},n,{get:function(){return i}}),delete n.value}Object.defineProperty(e,t,n)},ng.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},ng.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},ng.prototype.getProperty=function(e,t){var n=this.model,i=n.getPropertyDescriptor(e,t);if(i)return i;if(t.includes(":"))return null;let r=n.config.strict;if(void 0!==r){let n=TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw n;"u">typeof console&&console.warn(n)}return null},nb.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw Error("unknown type <"+e+">");return new n(t)},nb.prototype.getType=function(e){var t=this.typeCache,n=w(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},nb.prototype.createAny=function(e,t,n){var i=nh(e),r={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){var n;let i;n=[e],i=this,R(n,function(e,r){if("number"!=typeof e&&"string"!=typeof e)throw Error("illegal key type: "+typeof e+". Key should be of type number or string.");if("constructor"===e)throw Error("illegal key: constructor");if("__proto__"===e)throw Error("illegal key: __proto__");let o=n[r+1],a=i[e];g(o)&&y(a)&&(a=i[e]=isNaN(+o)?{}:[]),m(o)?m(t)?delete i[e]:i[e]=t:i=a})}},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,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),R(n,function(e,t){b(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e}),r},nb.prototype.getPackage=function(e){return this.registry.getPackage(e)},nb.prototype.getPackages=function(){return this.registry.getPackages()},nb.prototype.getElementDescriptor=function(e){return e.$descriptor},nb.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},nb.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},nb.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var n_=String.fromCharCode,nx=Object.prototype.hasOwnProperty,nw=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,nE={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function nS(e,t,n,i){if(i)if(nx.call(nE,i))return nE[i];else return"&"+i+";";return t?n_(t):n_(parseInt(n,16))}function nk(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(nw,nS):e}Object.keys(nE).forEach(function(e){nE[e.toUpperCase()]=nE[e]});var nC="non-whitespace outside of root node";function nR(e){return Error(e)}function nP(e){return{get:e,enumerable:!0}}function nA(e,t,n,i){n in t||(t[n]=n in e?e[n]:null),e[n]=i}function nM(){return{line:0,column:0}}function nT(e){throw e}function nB(e){if(!this)return new nB(e);var t,n,i,r,o,a,s,c,l,p,u,h,d=e&&e.proxy,f=nT,m=nM,g=!1,y=!1,v="",b=!1,_=!1,x=null,w=!1;function E(e){e instanceof Error||(e=nR(e)),x=e,f(e,m)}function S(e){l&&(e instanceof Error||(e=nR(e)),l(e,m))}function k(){t=_?[]:null,n=_?function(e){var t,n,i=Object.create(null);for(t in e)i[n=e[t]]=n,i[n+"$uri"]=t;return i}(r):null,i=[],m=nM,w=!1,x=null,y=!1,v=""}function C(e,l=!1){var f,g,v,x,k,R,P,A,M,T,B,D,j=null,O=0,N=!1,L=!1,$=0,I=0,F="",z=0;function H(e,t){var i=e.indexOf(":");if(-1===i)return e;var r=n[e.substring(0,i)];return r?t===r?e.substr(i+1):r+e.substr(i):(S("missing namespace for prefix <"+e.substring(0,i)+">"),null)}function V(){if(null!==D)return D;var e,t,i,o,a,s,c,l,p,u=_&&n.xmlns,h=_&&b?[]:null,d=z,m=F,y=m.length,v={},x=new Set;e:for(;d<y;
1d++){if(c=!1,32!==(l=m.charCodeAt(d))&&(!(l<14)||!(l>8))){for((l<65||l>122||l>90&&l<97)&&95!==l&&58!==l&&(S("illegal first char attribute name"),c=!0),p=d+1;p<y;p++)if((!((l=m.charCodeAt(p))>96)||!(l<123))&&(!(l>64)||!(l<91))&&(!(l>47)||!(l<59))&&46!==l&&45!==l&&95!==l){if(32===l||l<14&&l>8){S("missing attribute value"),d=p;continue e}if(61===l)break;S("illegal attribute name char"),c=!0}if("xmlns:xmlns"===(s=m.substring(d,p))&&(S("illegal declaration of xmlns"),c=!0),34===(l=m.charCodeAt(p+1)))-1===(p=m.indexOf('"',d=p+2))&&-1!==(p=m.indexOf("'",d))&&(S("attribute value quote missmatch"),c=!0);else if(39===l)-1===(p=m.indexOf("'",d=p+2))&&-1!==(p=m.indexOf('"',d))&&(S("attribute value quote missmatch"),c=!0);else for(S("missing attribute value quotes"),c=!0,p+=1;p<y&&32!==(l=m.charCodeAt(p+1))&&(!(l<14)||!(l>8));p++);for(-1===p&&(S("missing closing quotes"),p=y,c=!0),c||(o=m.substring(d,p)),"xmlns:xml"===s&&"http://www.w3.org/XML/1998/namespace"!==o&&E("illegal value of xmlns:xml"),d=p;p+1<y&&32!==(l=m.charCodeAt(p+1))&&(!(l<14)||!(l>8));p++)d===p&&(S("illegal character after attribute end"),c=!0);if(d=p+1,!c){if(x.has(s)){S("attribute <"+s+"> already defined");continue}if(x.add(s),!_){v[s]=o;continue}if(b){if(null!==(i="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=nk(o),t=i+"$uri",!(a=r[e])){if("xmlns"===i||t in n&&n[t]!==e)do a="ns"+O++;while(void 0!==n[a])else a=i;r[e]=a}n[i]!==a&&(f||(f=Object.create(null)),j=null,g=null,nA(n,f,i,a),"xmlns"===i&&(nA(n,f,a+"$uri",e),u=a),nA(n,f,t,e)),v[s]=o;continue}h.push(s,o);continue}null!==(s=H(s,u))&&(v[s]=o)}}}if(b)for(d=0,y=h.length;d<y;d++)s=H(h[d++],u),o=h[d],null!==s&&(v[s]=o);return D=v}for(m=function(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,o=0,a=0,s=I;$>=a&&(t=i.exec(e))&&!((s=t[0].length+t.index)>$);)r+=1,a=s;return -1==$?(o=s,n=e.substring(I)):0===I?n=e.substring(I,$):(o=$-a,n=-1==I?e.substring($):e.substring($,I+1)),{data:n,line:r,column:o}},d&&(B=Object.create({},{name:nP(function(){return M}),originalName:nP(function(){return T}),attrs:nP(V),ns:nP(function(){return g||(g=Object.assign(Object.create(null),n)),g})}));-1!==I;){if(-1===($=60===e.charCodeAt(I)?I:e.indexOf("<",I))){if(l)return e.substring(I);if(i.length)return E("unexpected end of file");if(!y)return E("missing start tag");I<e.length&&e.substring(I).trim()&&S(nC);return}if(y||(y=!0),I!==$){if(i.length){if(o&&(o(e.substring(I,$),nk,m),w))return}else if(e.substring(I,$).trim()&&(S(nC),w))return}if(33===(R=e.charCodeAt($+1))){if(91===(k=e.charCodeAt($+2))&&"CDATA["===e.substr($+3,6)){if(-1===(I=e.indexOf("]]>",$))){if(l)return e.substring($);return E("unclosed cdata")}if(c&&(c(e.substring($+9,I),m),w))return;I+=3;continue}if(45===k&&45===e.charCodeAt($+3)){if(-1===(I=e.indexOf("--\x3e",$))){if(l)return e.substring($);return E("unclosed comment")}if(p&&(p(e.substring($+4,I),nk,m),w))return;I+=3;continue}}if(63===R){if(-1===(I=e.indexOf("?>",$))){if(l)return e.substring($);return E("unclosed question")}if(u&&(u(e.substring($,I+2),m),w))return;I+=2;continue}for(v=$+1;;v++){if(isNaN(P=e.charCodeAt(v))){if(l)return e.substring($);return I=-1,E("unclosed tag")}if(34===P)v=-1!==(k=e.indexOf('"',v+1))?k:v;else if(39===P)v=-1!==(k=e.indexOf("'",v+1))?k:v;else if(62===P){I=v;break}}if(33===R){if(h&&(h(e.substring($,I+1),nk,m),w))return;I+=1;continue}if(D={},47===R){if(N=!1,L=!0,!i.length)return E("missing open tag");if(v=M=i.pop(),k=$+2+v.length,e.substring($+2,k)!==v)return E("closing tag mismatch");for(;k<I;k++)if(32!==(R=e.charCodeAt(k))&&(!(R>8)||!(R<14)))return E("close tag")}else{if(47===e.charCodeAt(I-1)?(v=M=e.substring($+1,I-1),N=!0,L=!0):(v=M=e.substring($+1,I),N=!0,L=!1),!(R>96&&R<123||R>64&&R<91||95===R||58===R))return E("illegal first char nodeName");for(k=1,x=v.length;k<x;k++)if((!((R=v.charCodeAt(k))>96)||!(R<123))&&(!(R>64)||!(R<91))&&(!(R>47)||!(R<59))&&45!==R&&95!==R&&46!=R){if(32===R||R<14&&R>8){M=v.substring(0,k),D=null;break}return E("invalid nodeName")}L||i.push(M)}if(_){N&&(f=null,null===D&&(b=-1!==v.indexOf("xmlns",k))&&(z=k,F=v,V(),b=!1),L||t.push(f)),T=
1M,null===j&&(j=Object.create(null));var G=j[M];if(void 0!==G)M=G;else{if(-1!==(R=M.indexOf(":"))){if(!(A=n[M.substring(0,R)]))return E("missing namespace on <"+T+">");M=M.substr(R+1)}else A=n.xmlns;A&&(M=A+":"+M),j[T]=M}}if(N&&(z=k,F=v,a)&&(d?a(B,nk,L,m):a(M,V,nk,L,m),w))return;if(L){if(s&&(s(d?B:M,nk,N,m),w))return;_&&(N||(f=t.pop()),f&&(!function(e,t){var n,i;for(n in t)null===(i=t[n])?delete e[n]:e[n]=i}(n,f),f=null,j=null,g=null))}I+=1}}this.on=function(e,t){if("function"!=typeof t)throw nR("required args <name, cb>");switch(e){case"openTag":a=t;break;case"text":o=t;break;case"closeTag":s=t;break;case"error":f=t;break;case"warn":l=t;break;case"cdata":c=t;break;case"attention":h=t;break;case"question":u=t;break;case"comment":p=t;break;default:throw nR("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw nR("required args <nsMap={}>");var t,n=Object.create(null);for(t in e)n[t]=e[t];return _=!0,r=n,this},this.parse=function(e){if("string"!=typeof e)throw nR("required args <xml=string>");if(g)throw nR("parse during stream; call end() first");return k(),C(e),m=nM,w=!1,x},this.write=function(e){if("string"!=typeof e)throw nR("required args <xml=string>");return g||(k(),g=!0),x||(v=C(v+e,!0)||""),this},this.end=function(){return g||k(),g=!1,x||C(v),v="",m=nM,w=!1,x},this.stop=function(){w=!0}}function nD(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var nj={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},nO="property";function nN(e){return e.xml&&e.xml.serialize}function nL(e,t){var n;return nD(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name}function n$(e){return Error(e)}function nI(e){return e.$descriptor}function nF(e){G(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw n$("expected element");var t,n=this.elementsById,i=nI(e).idProperty;
1if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw Error("illegal ID <"+t+">");if(n[t])throw n$("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function nz(){}function nH(){}function nV(){}function nG(e,t){this.property=e,this.context=t}function nW(e,t){this.element=t,this.propertyDesc=e}function nU(){}function nq(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function nK(e,t,n){nq.call(this,e,t,n)}function nY(e,t,n){this.model=e,this.context=n}function nX(e){e instanceof nb&&(e={model:e}),G(this,{lax:!1},e)}nz.prototype.handleEnd=function(){},nz.prototype.handleText=function(){},nz.prototype.handleNode=function(){},nH.prototype=Object.create(nz.prototype),nH.prototype.handleNode=function(){return this},nV.prototype=Object.create(nz.prototype),nV.prototype.handleText=function(e){this.body=(this.body||"")+e},nG.prototype=Object.create(nV.prototype),nG.prototype.handleNode=function(e){if(this.element)throw n$("expected no sub nodes");return this.element=this.createReference(e),this},nG.prototype.handleEnd=function(){this.element.id=this.body},nG.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},nW.prototype=Object.create(nV.prototype),nW.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=nu(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},nU.prototype=Object.create(nV.prototype),nU.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},nq.prototype=Object.create(nU.prototype),nq.prototype.addReference=function(e){this.context.addReference(e)},nq.prototype.handleText=function(e){if(!nI(this.element).bodyProperty)throw n$("unexpected body text <"+e+">");nV.prototype.handleText.call(this,e)},nq.prototype.handleEnd=function(){var e=this.body,t=this.element,n=nI(t).bodyProperty;n&&void 0!==e&&(e=nu(n.type,e),t.set(n.name,e))},nq.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=nI(i),o=this.context,a=new i({}),s=this.model;return R(n,function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?R(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=nu(i.type,e):"xmlns"===n?n=":"+n:(t=nh(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},nq.prototype.getPropertyForNode=function(e){var t,n,i,r,o,a=nh(e.name),s=this.type,c=this.model,l=nI(s),p=a.name,u=l.propertiesByName[p];if(u&&!u.isAttr){let a,s=(a=nN(u))!==nO&&(a||null);if(s){let a=e.attributes[s];if(a){let s,l,p=(t=e.ns,s=nh(a,t.xmlns),l=nh(`${t[s.prefix]||s.prefix}:${s.localName}`),n=c.getPackage(l.prefix),i=l.name,r=l.localName,(o=n&&n.xml&&n.xml.typePrefix)&&0===r.indexOf(o)?l.prefix+":"+r.slice(o.length):i);return G({},u,{effectiveType:nI(c.getType(p)).name})}}return u}var h=c.getPackage(a.prefix);if(h){let e=nL(a,h),t=c.getType(e);if(u=S(l.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&t.hasType(e.type)}))return G({},u,{effectiveType:nI(t).name})}else if(u=S(l.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return u;throw n$("unrecognized element <"+a.name+">")},nq.prototype.toString=function(){return"ElementDescriptor["+nI(this.type).name+"]"},nq.prototype.valueHandler=function(e,t){return new nW(e,t)},nq.prototype.referenceHandler=function(e){return new nG(e,this.context)},nq.prototype.handler=function(e){return"Element"===e?new nY(this.model,e,this.context):new nq(this.model,e,this.context)},nq.prototype.handleChild=function(e){if(t=this.getPropertyForNode(e),i=this.element,np[n=t.effectiveType||t.type])return this.valueHandler(t,i);var t,n,i,r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e),o=r.element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(G(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},nK.prototype=Object.create(nq.prototype),nK.prototype.createElement=function(e){var t=e.name,n=nh(t),i=this.model,r=this.t
1ype,o=i.getPackage(n.prefix),a=o&&nL(n,o)||t;if(!r.hasType(a))throw n$("unexpected element <"+e.originalName+">");return nq.prototype.createElement.call(this,e)},nY.prototype=Object.create(nU.prototype),nY.prototype.createElement=function(e){var t=e.name,n=nh(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},nY.prototype.handleChild=function(e){var t=new nY(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},nY.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},nX.prototype.fromXML=function(e,t,n){var i,r=t.rootHandler;t instanceof nq?(r=t,t={}):"string"==typeof t?(r=this.handler(t),t={}):"string"==typeof r&&(r=this.handler(r));var o=this.model,a=this.lax,s=new nF(G({},t,{rootHandler:r})),c=new nB({proxy:!0}),l=(Object.defineProperty(i=[],"peek",{value:function(){return this[this.length-1]}}),i);function p(e,t,n){var i=t(),r=i.line,o=i.column,a=i.data;"<"===a.charAt(0)&&-1!==a.indexOf(" ")&&(a=a.slice(0,a.indexOf(" "))+">");var c="unparsable content "+(a?a+" ":"")+`detected 2 line: `+r+` 3 column: `+o+` 4 nested error: `+e.message;if(n)return s.addWarning({message:c,error:e}),!0;throw n$(c)}function u(e,t){return p(e,t,!0)}r.context=s,l.push(r);var h=/^<\?xml /i,d=/ encoding="([^"]+)"/i,f=/^utf-8$/i;function m(e,t){try{l.peek().handleText(e)}catch(e){u(e,t)}}var g=o.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},Object.entries(nj).reduce(function(e,[t,n]){return e[n]=t,e},o.config&&o.config.nsMap||{}));return c.ns(g).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},{}),s={name:e.name,originalName:e.originalName,attributes:o,ns:e.ns},c=l.peek();try{l.push(c.handleNode(s))}catch(e){p(e,i,a)&&l.push(new nH)}}).on("question",function(e){if(h.test(e)){var t=d.exec(e),n=t&&t[1];!n||f.test(n)||s.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){var i;i=t(e),i.trim()&&m(i,n)}).on("error",p).on("warn",u),new Promise(function(t,n){try{c.parse(e),function(){var e,t,n=s.elementsById,i=s.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],a=nI(r).propertiesByName[t.property];if(o||s.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),a.isMany){var c=r.get(a.name),l=c.indexOf(t);-1===l&&(l=c.length),o?c[l]=o:c.splice(l,1)}else r.set(a.name,o)}}()}catch(e){i=e}var i,o=r.element;i||o||(i=n$("failed to parse document as <"+r.type.$descriptor.name+">"));var a=s.warnings,l=s.references,p=s.elementsById;return i?(i.warnings=a,n(i)):t({rootElement:o,elementsById:p,references:l,warnings:a})})},nX.prototype.handler=function(e){return new nK(this.model,e)};var nZ=`<?xml version="1.0" encoding="UTF-8"?> 5`,nJ=/<|>|'|"|&|\n\r|\n/g,nQ=/<|>|&/g;function n0(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}function n1(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function n2(e){return w(e)?e:(e.prefix?e.prefix+":":"")+e.localName}n0.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e},n0.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]},n0.prototype.resolve=function(e){for(var t=this;t;){var n=e(t);if(n)return n;t=t.parent}},n0.prototype.eachScope=function(e){for(var t=this;t;)e(t),t=t.parent},n0.prototype.byUri=function(e){return this.resolve(function(t){return t.uriMap[e]})},n0.prototype.add=function(e,t){this.uriMap[e.uri]=e,t?this.wellknown.push(e):this.custom.push(e),this.mapPrefix(e.prefix,e.uri)},n0.prototype.uriByPrefix=function(e){var t=e||"xmlns";return this.resolve(function(e){return e.prefixMap[t]})},n0.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t},n0.prototype.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},n0.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e),i=this.byUri(t);this.eachScope(function(e){e.used[n]=i})},n0.prototype.getUsed=function(e){return[].concat(this.wellknown,this.custom).filter(e=>{var t=this.getNSKey(e);return this.used[t]})};var n5={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},n3={"<":"lt",">":"gt","&":"amp"};function n6(e,t,n){return(e=w(e)?e:""+e).replace(t,function(e){return"&"+n[e]+";"})}function n9(e){this.tagName=e}function n4(){}function n8(e){this.tagName=e}function n7(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function ie(e,t,n){n7.call(this,e,t),this.serialization=n}function it(){this.value="",this.write=function(e){this.value+=e}}function ii(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write(` 6`),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 ir(e){return e=G({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new it,r=new ii(i,e.format);e.preamble&&r.append(nZ);var o=new n7,a=t.$model;if(o.getNamespaces().mapDefaultPrefixes(function(e){let t=e.config&&e.config.nsMap||{},n={};for(let e in nj)n[e]=nj[e];for(let e in t)n[t[e]]=e;for(let t of e.getPackages())n[t.prefix]=t.uri;return n}
6(a)),o.build(t).serializeTo(r),!n)return i.value}}}function io(e,t){nb.call(this,e,t)}n9.prototype.build=function(e){return this.element=e,this},n9.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},n4.prototype.serializeValue=n4.prototype.serializeTo=function(e){e.append(this.escape?n6(this.value,nQ,n3):this.value)},n4.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(nQ)&&(this.escape=!0),this},n1(n8,n4),n8.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},n7.prototype.build=function(e){return function(e,t){for(var n=[{serializer:e,children:e.enter(t),index:0}];n.length;){var i=n[n.length-1];if(i.index>=i.children.length){i.serializer.exit(),n.pop();continue}var r=i.children[i.index++],o=r.create();i.serializer.body.push(o),r.element&&n.push({serializer:o,children:o.enter(r.element),index:0})}}(this,e),this},n7.prototype.enter=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,i=t.isGeneric;if(i?this.otherAttrs=this.parseGenericNsAttributes(e):this.otherAttrs=this.parseNsAttributes(e),n?this.ns=this.nsPropertyTagName(n):this.ns=this.nsTagName(t),this.tagName=this.addTagName(this.ns),i)return this.collectGenericContainments(e);var r=C(e.$descriptor.properties,function(t){var n=t.name;if(t.isVirtual||!E(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)});return this.parseAttributes(C(r,function(e){return e.isAttr})),this.collectContainments(C(r,function(e){return!e.isAttr}))},n7.prototype.exit=function(){this.parseGenericAttributes(this.element,this.otherAttrs)},n7.prototype.nsTagName=function(e){var t;return t=this.logNamespaceUsed(e.ns),e.isGeneric?G({localName:e.ns.localName},t):G({localName:function(e,t){return nD(t)?e.charAt(0).toLowerCase()+e.slice(1):e}(e.ns.localName,e.$pkg)},t)},n7.prototype.nsPropertyTagName=function(e){var t;return t=this.logNamespaceUsed(e.ns),G({localName:e.ns.localName},t)},n7.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},n7.prototype.nsAttributeName=function(e){if(t=w(e)?nh(e):e.ns,e.inherited)return{localName:t.localName};var t,n=this.logNamespaceUsed(t);return(this.getNamespaces().logUsed(n),this.isLocalNs(n))?{localName:t.localName}:G({localName:t.localName},n)},n7.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter(([t,n])=>!t.startsWith("$")&&this.parseNsAttribute(e,t,n)).map(([e,t])=>({name:e,value:t}))},n7.prototype.collectGenericContainments=function(e){var t=this,n=[],i=e.$body;i&&n.push({create:function(){return new n4().build({type:"String"},i)}});var r=e.$children;return r&&R(r,function(e){n.push({create:function(){return new n7(t)},element:e})}),n},n7.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=nh(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)}},n7.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,i=[];return R(n,function(n,r){var o=t.parseNsAttribute(e,r,n);o&&i.push(o)}),i},n7.prototype.parseGenericAttributes=function(e,t){var n=this;R(t,function(t){try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){"u">typeof console&&console.warn(`missing namespace information for <${t.name}=${t.value}> on`,e,n)}})},n7.prototype.collectContainments=function(e){var t=this,n=this.element,i=[];return R(e,function(e){var r=n.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)i.push({create:function(){return new n4().build(e,r[0])}});else if(np[e.type])R(r,function(n){i.push({create:function(){return new n8(t.addTagName(t.nsPropertyTagName(e))).build(e,n)}})});else if(o)R(r,function(n){i.push({create:function(){return new n9(t.addTagName(t.nsPropertyTagName(e))).build(n)}})});else{var a=nN(e);R(r,function(n){i.push({create:function(){return a?a===nO?new n7(t,e):new ie(t,e,a):new n7(t)},element:n})})}}),i},n7.prototype.getNamespaces=function(e){var t=this.namespaces;if(!t){var n=this.getParentNamespaces();e||!n?this.namespaces=t=new n0(n):t=n}return t},n7.prototype.getParentNamespaces=function(){if(void 0!==this.parentNamespaces)return this.parentNamespaces;for(var e=null,t=this.parent;t;){if(t.namespaces){e=t.namespaces;break}if(void 0!==t.parentNamespaces){e=t.parentNamespaces;break}t=t.parent}return this.parentNamespaces=e},n7.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},n7.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.getNamespaces(t),a=e.prefix,s=e.uri;if(!a&&!s)return{localName:e.localName};if(r=o.defaultUriByPrefix(a),!(s=s||r||o.uriByPrefix(a)))throw Error("no namespace uri given for prefix <"+a+">");if((e=o.byUri(s))||a||(e=this.logNamespace({uri:s},r===s,!0)),!e){for(n=a,i=1;o.uriByPrefix(n);)n=a+"_"+i++;e=this.logNamespace({prefix:n,uri:s},r===s)}return a&&o.mapPrefix(a,s),e},n7.prototype.parseAttributes=function(e){var t=this,n=this.element;R(e,function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];R(i,function(e){r.push(e.id)}),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)})},n7.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),n2(e)},n7.prototype.addAttribute=function(e,t){var n=this.attrs;w(t)&&(t=n6(t,nJ,n5));var i=k(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)},n7.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=n.getUsed().filter(function(e){return"xml"!==e.prefix}).map(function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}}).concat(t)),R(t,function(t){e.append(" ").append(n2(t.name)).append('="').append(t.value).append('"')})},n7.prototype.serializeTo=function(e){!function(e,t){for(var n=[{serializer:e,index:0,opened:!1,indent:!1}];n.length;
vendor: 1,401 bytes, line 6
6){var i=n[n.length-1],r=i.serializer;if(!i.opened){var o=r.body[0];if(i.indent=o&&o.constructor!==n4,t.appendIndent().append("<"+r.tagName),r.serializeAttributes(t),t.append(o?">":" />"),i.opened=!0,!o){t.appendNewLine(),n.pop();continue}i.indent&&t.appendNewLine().indent()}if(i.index<r.body.length){var a=r.body[i.index++];a instanceof n7?n.push({serializer:a,index:0,opened:!1,indent:!1}):a.serializeTo(t);continue}i.indent&&t.unindent().appendIndent(),t.append("</"+r.tagName+">").appendNewLine(),n.pop()}}(this,e)},n1(ie,n7),ie.prototype.parseNsAttributes=function(e){var t=n7.prototype.parseNsAttributes.call(this,e).filter(e=>e.name!==this.serialization),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(this.serialization),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},ie.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},io.prototype=Object.create(nb.prototype),io.prototype.fromXML=function(e,t,n){w(t)||(n=t,t="bpmn:Definitions");var i=new nX(G({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},io.prototype.toXML=function(e,t){var n=new ir(t);return new Promise(function(t,i){try{var r=n.toXML(e);return t({xml:r})}catch(e){return i(e)}})};let ia
vendor: 34,508 bytes, line 6
6={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",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
6is(e,t){return new io(G({},ia,e),t)}function ic(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function il(e,t){return e.$instanceOf(t)}function ip(e){var t={},n=[],i={};function r(e,t){return function(n){e(n,t)}}function o(n,r){try{var o=i[n.id]&&function(t,n){if(t.gfx)throw Error(`already rendered ${ic(t)}`);return e.element(t,i[t.id],n)}(n,r);return t[n.id]=n,o}catch(e){a(e.message,{element:n,error:e}),console.error(`failed to import ${ic(n)}`,e)}}function a(t,n){e.error(t,n)}var s=this.registerDi=function(e){var t=e.bpmnElement;t?i[t.id]?a(`multiple DI elements defined for ${ic(t)}`,{element:t}):i[t.id]=e:a(`no bpmnElement referenced in ${ic(e)}`,{element:e})};function c(e){s(e)}this.handleDefinitions=function(o,h){var d,f,g,y,v,b=o.diagrams;if(h&&-1===b.indexOf(h))throw Error("diagram not part of <bpmn:Definitions />");if(!h&&b&&b.length&&(h=b[0]),!h)throw Error("no diagram to display");i={};var _=h.plane;s(_),R(_.planeElement,c);var x=h.plane;if(!x)throw Error(`no plane for ${ic(h)}`);var E=x.bpmnElement;
6if(!E)if(E=S(o.rootElements,function(e){return il(e,"bpmn:Process")||il(e,"bpmn:Collaboration")}))a(`correcting missing bpmnElement on ${ic(x)} to ${ic(E)}`),x.bpmnElement=E,s(x);else throw Error("no process or collaboration to display");var k=(v=E,e.root(v,i[v.id],x));if(il(E,"bpmn:Process")||il(E,"bpmn:SubProcess"))p(E,k);else if(il(E,"bpmn:Collaboration")){d=E,f=k,R(d.participants,r(w,f)),n.push(function(){R(d.messageFlows,r(u,f))}),m(d.artifacts,f),g=o.rootElements,y=k,C(g,function(e){return!t[e.id]&&il(e,"bpmn:Process")&&e.laneSets}).forEach(r(p,y))}else throw Error(`unsupported bpmnElement for ${ic(x)}: ${ic(E)}`);l(n)};var l=this.handleDeferred=function(){for(;n.length;)n.shift()()};function p(e,n){x(e,n),g(e.ioSpecification,n),m(e.artifacts,n),t[e.id]=e}function u(e,t){o(e,t)}function h(e,t){o(e,t)}function d(e,t){o(e,t)}function f(e,t){o(e,t)}function m(e,t){R(e,function(e){il(e,"bpmn:Association")?n.push(function(){o(e,t)}):o(e,t)})}function g(e,t){e&&(R(e.dataInputs,r(d,t)),R(e.dataOutputs,r(f,t)))}var y=this.handleSubProcess=function(e,t){x(e,t),m(e.artifacts,t)};function v(e,t){var i=o(e,t);il(e,"bpmn:SubProcess")&&y(e,i||t),il(e,"bpmn:Activity")&&g(e.ioSpecification,t),n.push(function(){R(e.dataInputAssociations,r(h,t)),R(e.dataOutputAssociations,r(h,t))})}function b(e,t){n.push(function(){var n,i=o(e,t);e.childLaneSet&&_(e.childLaneSet,i||t),R((n=e).flowNodeRef,function(e){var t=e.get("lanes");t&&t.push(n)})})}function _(e,t){R(e.lanes,r(b,t))}function x(e,t){var i,s;i=e.flowElements,s=t,R(i,function(e){il(e,"bpmn:SequenceFlow")?n.push(function(){o(e,s)}):il(e,"bpmn:BoundaryEvent")?n.unshift(function(){v(e,s)}):il(e,"bpmn:FlowNode")?v(e,s):il(e,"bpmn:DataObject")||(il(e,"bpmn:DataStoreReference")||il(e,"bpmn:DataObjectReference")?o(e,s):a(`unrecognized flowElement ${ic(e)} in context ${ic(s&&s.businessObject)}`,{element:e,context:s}))}),e.laneSets&&R(e.laneSets,r(_,t))}function w(e,t){var n=o(e,t),i=e.processRef;i&&p(i,n||t)}}function iu(e,t){var n=id(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function ih(e,t){return M(t,function(t){return iu(e,t)})}function id(e){return e&&e.businessObject||e}function im(e){return e&&e.di}var ig='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>',iy={verticalAlign:"middle"},iv={color:"#404040"},ib={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},i_={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},ix={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"},iw='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+ig+'</a><span>Web-based tooling for BPMN, DMN and forms powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>';let iE="djs-outline-hidden";function iS(e){var t;let n;e=G({},iC,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),t=this._container,q(es("svg",n=eu('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+ig+"</a>")),iy),q(n,iv,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),t.appendChild(n),en.bind(n,"click",function(e){c||(q(c=eu(iw),ib),q(es("svg",c),iy),q(es(".backdrop",c),i_),q(es(".notice",c),ix),q(es(".link",c),iv,{margin:"15px 20px 15px 10px",alignSelf:"center"}),er(c,".backdrop","click",function(e){document.body.removeChild(c)})),document.body.appendChild(c),e.preventDefault()})}function ik(e,t){return e.warnings=t,e}i(iS,na),iS.prototype.importXML=async function(e,t){var n,i;let r=[];try{let i;e=this._emit("import.parse.start",{xml:e})||e;try{i=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(e){throw this._emit("import.parse.complete",{error:e}),e}let o=i.rootElement,a=i.references,s=i.warnings,c=i.elementsById;r=r.concat(s),o=this._emit("import.parse.complete",(n={error:null,definitions:o,elementsById:c,references:a,warnings:r},this.get("eventBus").createEvent(n)))||o;let l=await this.importDefinitions(o,t);return r=r.concat(l.warnings),this._emit("import.done",{error:null,warnings:r}),{warnings:r}}catch(n){let e,t=n;throw r=r.concat(t.warnings||[]),ik(t,r),i=t,(e=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(i.message))&&(i.message="unparsable content <"+e[1]+"> detected;
6 this may indicate an invalid BPMN 2.0 diagram file"+e[2]),t=i,this._emit("import.done",{error:t,warnings:t.warnings}),t}},iS.prototype.importDefinitions=async function(e,t){return this._setDefinitions(e),{warnings:(await this.open(t)).warnings}},iS.prototype.open=async function(e){var t,n,i,r,o,a,s,c,l;let p=this._definitions,u=e;if(!p){let e=Error("no XML imported");throw ik(e,[]),e}if("string"==typeof e&&(c=p,!(u=(l=e)&&S(c.diagrams,function(e){return e.id===l})||null))){let t=Error("BPMNDiagram <"+e+"> not found");throw ik(t,[]),t}try{this.clear()}catch(e){throw ik(e,[]),e}let{warnings:h}=await (t=this,n=u,s=[],new Promise(function(e,c){try{i=t.get("bpmnImporter"),r=t.get("eventBus"),o=t.get("canvas"),r.fire("import.render.start",{definitions:p});var l=n,u=new ip({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})}});l=l||p.diagrams&&p.diagrams[0];var h=function(e,t){if(t&&t.plane){var n,i=t.plane.bpmnElement,r=i;iu(i,"bpmn:Process")||iu(i,"bpmn:Collaboration")||(r=function(e){for(var t=e;t;){if(iu(t,"bpmn:Process"))return t;t=t.$parent}}(i)),n=iu(r,"bpmn:Collaboration")?r:S(e.rootElements,function(e){if(iu(e,"bpmn:Collaboration"))return S(e.participants,function(e){return e.processRef===r})});var o=[r];n&&(o=T(n.participants,function(e){return e.processRef})).push(n);var a=function e(t){var n=[];return R(t,function(t){t&&(n.push(t),n=n.concat(e(t.flowElements)))}),n}(o),s=[t],c=[i];return R(e.diagrams,function(e){if(e.plane){var t=e.plane.bpmnElement;-1!==a.indexOf(t)&&-1===c.indexOf(t)&&(s.push(e),c.push(t))}}),s}}(p,l);if(!h)throw Error("no diagram to display");R(h,function(e){u.handleDefinitions(p,e)});var d=l.plane.bpmnElement.id;return o.setRootElement(o.findRoot(d+"_plane")||o.findRoot(d)),r.fire("import.render.complete",{error:a,warnings:s}),e({warnings:s})}catch(e){return e.warnings=s,c(e)}}));return{warnings:h}},iS.prototype.saveXML=async function(e){e=e||{};let t=this._definitions,n,i;try{if(!t)throw Error("no definitions loaded");t=this._emit("saveXML.start",{definitions:t})||t,i=(await this._moddle.toXML(t,e)).xml,i=this._emit("saveXML.serialized",{xml:i})||i}catch(e){n=e}let r=n?{error:n}:{xml:i};if(this._emit("saveXML.done",r),n)throw n;return r},iS.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{let t,n=this.get("canvas"),i=n.getActiveLayer(),r=es(":scope > defs",n._svg),o=ej(i),a=r?"<defs>"+ej(r)+"</defs>":"",s=n.getContainer();X(s).add(iE);try{t=i.getBBox()}finally{X(s).remove(iE)}let c=t.x-5,l=t.y-5,p=t.width+10,u=t.height+10;e=`<?xml version="1.0" encoding="utf-8"?> 7<!-- created with bpmn-js / http://bpmn.io --> 8<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> 9<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+p+'" height="'+u+'" viewBox="'+c+" "+l+" "+p+" "+u+'" version="1.1">'+a+o+"</svg>"}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},iS.prototype._setDefinitions=function(e){this._definitions=e},iS.prototype.getModules=function(){return this._modules},iS.prototype.clear=function(){this.getDefinitions()&&na.prototype.clear.call(this)},iS.prototype.destroy=function(){na.prototype.destroy.call(this),el(this._container)},iS.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},iS.prototype.off=function(e,t){this.get("eventBus").off(e,t)},iS.prototype.attachTo=function(e){if(!e)throw Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=es(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},iS.prototype.getDefinitions=function(){return this._definitions},iS.prototype.detach=function(){let e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},iS.prototype._init=function(e,t,n){let i=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],n.modules||this.getModules(n),n.additionalModules||[]),r=G(U(n,["additionalModules"]),{canvas:G({},n.canvas,{container:e}),modules:i});na.call(this,r),n&&n.container&&this.attachTo(n.container)},iS.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},iS.prototype._createContainer=function(e){let t=eu('<div class="bjs-container bio-theme-parent"></div>');return q(t,{width:iR(e.width),height:iR(e.height),position:e.position}),t},iS.prototype._createModdle=function(e){return new is(G({},this._moddleExtensions,e.moddleExtensions))},iS.prototype._modules=[];let iC={width:"100%",height:"100%",position:"relative"};function iR(e){return e+(_(e)?"px":"")}function iP(e){iS.call(this,e),this.on("import.parse.complete",function(e){e.error||this._collectIds(e.definitions,e.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}
9function iA(e,t){return!iu(e,"bpmn:CallActivity")&&(iu(e,"bpmn:SubProcess")?!!((t=t||im(e))&&iu(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!iu(e,"bpmn:Participant")||!!id(e).processRef)}function iM(e){if(iu(e,"bpmn:Participant")||iu(e,"bpmn:Lane")){var t=im(e).isHorizontal;return void 0===t||t}}function iT(e){return e&&!!id(e).triggeredByEvent}function iB(e,t){return M(id(e).eventDefinitions,function(e){return iu(e,t)})}i(iP,iS),iP.prototype._createModdle=function(e){var t=iS.prototype._createModdle.call(this,e);return t.ids=new u([32,36,1]),t},iP.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var iD={width:90,height:20};function ij(e){return iu(e,"bpmn:Event")||iu(e,"bpmn:Gateway")||iu(e,"bpmn:DataStoreReference")||iu(e,"bpmn:DataObjectReference")||iu(e,"bpmn:DataInput")||iu(e,"bpmn:DataOutput")||iu(e,"bpmn:SequenceFlow")||iu(e,"bpmn:MessageFlow")||iu(e,"bpmn:Group")}function iO(e){return tM(e.label)}function iN(e){if(e.waypoints){var t,n,i,r,o,a,s,c,l,p,u,h;return n=(t=e.waypoints).length/2-1,i=t[Math.floor(n)],r=t[Math.ceil(n+.01)],p=(l=t).length/2-1,u=l[Math.floor(p)],h=l[Math.ceil(p+.01)],o={x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},a=Math.atan((r.y-i.y)/(r.x-i.x)),s=o.x,c=o.y,Math.abs(a)<Math.PI/2?c-=15:s+=15,{x:s,y:c}}return iu(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+iD.height/2}:{x:e.x+e.width/2,y:e.y+e.height+iD.height/2}}function iL(e){return iu(e,"bpmn:FlowElement")||iu(e,"bpmn:Participant")||iu(e,"bpmn:Lane")||iu(e,"bpmn:SequenceFlow")||iu(e,"bpmn:MessageFlow")||iu(e,"bpmn:DataInput")||iu(e,"bpmn:DataOutput")?"name":iu(e,"bpmn:TextAnnotation")?"text":iu(e,"bpmn:Group")?"categoryValueRef":void 0}function i$(e){var t,n=e.businessObject,i=iL(n);if(i)return"categoryValueRef"===i?(t=n.categoryValueRef)&&t.value||"":n[i]||""}function iI(e){let t=[];return R(e.incoming,e=>{iu(e,"bpmn:Association")&&iu(e.source,"bpmn:TextAnnotation")&&t.push({annotation:e.source,association:e})}),R(e.outgoing,e=>{iu(e,"bpmn:Association")&&iu(e.target,"bpmn:TextAnnotation")&&t.push({annotation:e.target,association:e})}),t}function iF(e){let t=new Map;return R(e0(e,!0,-1),e=>{R(iI(e),e=>{t.has(e.annotation)||t.set(e.annotation,{annotation:e.annotation,associations:[]}),t.get(e.annotation).associations.push(e.association)})}),[...t.values()]}var iz="hsl(225, 10%, 15%)";function iH(e,t){return M(e.eventDefinitions,function(e){return e.$type===t})}function iV(e,t,n){var i=im(e);return n||i.get("color:background-color")||i.get("bioc:fill")||t||"white"}function iG(e,t,n){var i=im(e);return n||i.get("color:border-color")||i.get("bioc:stroke")||t||iz}function iW(e,t,n,i){var r=im(e).get("label");return i||r&&r.get("color:color")||t||iG(e,n)}function iU(e){var t=e.x+e.width/2,n=e.y+e.height/2,i=e.width/2;return eU([["M",t,n],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]])}function iq(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return eU([["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"]])}function iK(e,t={}){return{width:iY(e,t),height:iX(e,t)}}function iY(e,t={}){return E(t,"width")?t.width:e.width}function iX(e,t={}){return E(t,"height")?t.height:e.height}var iZ=new u;function iJ(e,t,n,i,r,o,a){eW.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,l=e&&e.defaultLabelColor;function p(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:iz,strokeWidth:2,fill:"white"})}function u(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:iz,strokeWidth:2})}function h(e,t){var{ref:n={x:0,y:0},scale:i=1,element:o,parentGfx:a=r._svg}=t,s=ek("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});ed(s,o);var c=es(":scope > defs",a);c||ed(a,c=ek("defs")),ed(c,s)}function d(e,t,n,i){var r,o,a,s,c,l=iZ.nextPrefixed("marker-");return r=e,o=l,a=t,s=n,c=i,"sequenceflow-end"===a&&h(o,{element:ek("path",{d:"M 1 5 L 11 10 L 1 15 Z",...p({fill:c,stroke:c,strokeWidth:1})}),ref:{x:11,y:10},scale:.5,parentGfx:r}),"messageflow-start"===a&&h(o,{element:ek("circle",{cx:6,cy:6,r:3.5,...p({fill:s,stroke:c,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6},parentGfx:r}),"messageflow-end"===a&&h(o,{element:ek("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...p({fill:s,stroke:c,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5},parentGfx:r}),"association-start"===a&&h(o,{element:ek("path",{d:"M 11 5 L 1 10 L 11 15",...u({fill:"none",stroke:c,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5,parentGfx:r}),"association-end"===a&&h(o,{element:ek("path",{d:"M 1 5 L 11 10 L 1 15",...u({fill:"none",stroke:c,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5,parentGfx:r}),"conditional-flow-marker"===a&&h(o,{element:ek("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...p({fill:s,stroke:c})}),ref:{x:-1,y:10},scale:.5,parentGfx:r}),"conditional-default-flow-marker"===a&&h(o,{element:ek("path",{d:"M 6 4 L 10 16",...p({stroke:c,fill:"none"})}),ref:{x:0,y:10},scale:.5,parentGfx:r}),"url(#"+l+")"}function f(e,t,n,i,r={}){b(i)&&(r=i,i=0),i=i||0;var o=ek("circle",{cx:t/2,cy:n/2,r:Math.round((t+n)/4-i),...r=p(r)});return ed(e,o),o}function m(e,t,n,i,r,o){b(r)&&(o=r,r=0);var a=ek("rect",{x:r=r||0,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i,...o=p(o)});return ed(e,a),a}function g(e,t,n,i){var r=eX(t,n=u(n),i);return ed(e,r),r}function y(e,t,n){var i=ek("path",{...n=u(n),d:t});return ed(e,i),i}function v(e,t,n,i){return y(t,n,G({"data-marker":e},i))}function _(e){return function(t,n,i){return $[e](t,n,i)}}var x=function(e,t,n={}){var r=n.width||t.width,o=n.height||t.height,a=n.width?1:2,l=f(e,r,o,.2*o,{fill:iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:a});y(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:r,containerHeight:o,position:{mx:.5,my:.5}}),{stroke:iG(t,c,n.stroke),strokeWidth:a});for(var p=0;p<12;p++){var u=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:r,containerHeight:o,position:{mx:.5,my:.5}}),h=r/2,d=o/2;y(e,u,{strokeWidth:1,stroke:iG(t,c,n.stroke),transform:"rotate("+30
9*p+","+d+","+h+")"})}return l},w=function(e,t,n={},r){var o=y(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:r?iG(t,c,n.stroke):"none",stroke:iG(t,c,n.stroke),strokeWidth:1});return ni(o,45),o};function E(e,t,n={},r){var o=id(e),a="bpmn:IntermediateThrowEvent"===o.$type||"bpmn:EndEvent"===o.$type,l=r||e;if(o.get("eventDefinitions")&&o.get("eventDefinitions").length>1)if(o.get("parallelMultiple"))return function(e,t,n={}){return y(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.458,my:.194}}),{fill:iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:1})}(t,l,n);else return function(e,t,n={},r){return y(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.211,my:.36}}),{fill:r?iG(t,c,n.stroke):iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:1})}(t,l,n,a);return iH(o,"bpmn:MessageEventDefinition")?function(e,t,n={},r){return y(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.235,my:.315}}),{fill:r?iG(t,c,n.stroke):iV(t,s,n.fill),stroke:r?iV(t,s,n.fill):iG(t,c,n.stroke),strokeWidth:1})}(t,l,n,a):iH(o,"bpmn:TimerEventDefinition")?x(t,l,n):iH(o,"bpmn:ConditionalEventDefinition")?function(e,t,n={}){return y(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.222}}),{fill:iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:1})}(t,l,n):iH(o,"bpmn:SignalEventDefinition")?function(e,t,n={},r){return y(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:r?iG(t,c,n.stroke):iV(t,s,n.fill),stroke:iG(t,c,n.stroke)})}(t,l,n,a):iH(o,"bpmn:EscalationEventDefinition")?function(e,t,n={},r){return y(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{fill:r?iG(t,c,n.stroke):iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:1})}(t,l,n,a):iH(o,"bpmn:LinkEventDefinition")?function(e,t,n={},r){return y(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:r?iG(t,c,n.stroke):iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:1})}(t,l,n,a):iH(o,"bpmn:ErrorEventDefinition")?function(e,t,n={},r){return y(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.2,my:.722}}),{fill:r?iG(t,c,n.stroke):iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:1})}(t,l,n,a):iH(o,"bpmn:CancelEventDefinition")?w(t,l,n,a):iH(o,"bpmn:CompensateEventDefinition")?function(e,t,n={},r){return y(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.22,my:.5}}),{fill:r?iG(t,c,n.stroke):iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:1})}(t,l,n,a):iH(o,"bpmn:TerminateEventDefinition")?function(e,t,n={}){return f(e,t.width,t.height,8,{fill:iG(t,c,n.stroke),stroke:iG(t,c,n.stroke),strokeWidth:4})}(t,l,n):null}var S={ParticipantMultiplicityMarker:function(e,t,n={}){var r=iY(t,n),o=iX(t,n);v("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:iV(t,s,n.fill),stroke:iG(t,c,n.stroke)})},SubProcessMarker:function(e,t,n={}){nn(m(e,14,14,0,{strokeWidth:1,fill:iV(t,s,n.fill),stroke:iG(t,c,n.stroke)}),t.width/2-7.5,t.height-20),v("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:iV(t,s,n.fill),stroke:iG(t,c,n.stroke)})},ParallelMarker:function(e,t,n){var r=iY(t,n),o=iX(t,n);v("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:iV(t,s,n.fill),stroke:iG(t,c,n.stroke)})},SequentialMarker:function(e,t,n){v("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:iV(t,s,n.fill),stroke:iG(t,c,n.stroke)})},CompensationMarker:function(e,t,n){v("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:iV(t,s,n.fill),stroke:iG(t,c,n.stroke)})},LoopMarker:function(e,t,n){var r=iY(t,n),o=iX(t,n);v("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:iG(t,c,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=iY(t,n),o=iX(t,n);v("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:iG(t,c,n.stroke),stroke:iG(t,c,n.stroke)})}};function k(e,t,n=[],i={}){i={fill:i.fill,stroke:i.stroke,width:iY(t,i),height:iX(t,i)};var r=id(t),o=n.includes("SubProcessMarker");i=o?{...i,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:{...i,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},r.get("isForCompensation")&&n.push("CompensationMarker"),iu(r,"bpmn:AdHocSubProcess")&&(n.push("AdhocMarker"),o||G(i,{compensation:i.compensation-18}));var a=r.get("loopCharacteristics"),s=a&&a.get("isSequential");a&&(G(i,{compensation:i.compensation-18}),n.includes("AdhocMarker")&&G(i,{seq:-23,loop:-18,parallel:-24}),void 0===s&&n.push("LoopMarker"),!1===s&&n.push("ParallelMarker"),!0===s&&n.push("SequentialMarker")),n.includes("CompensationMarker")&&1===n.length&&G(i,{compensation:-8}),R(n,function(n){var r;r=i,S[n](e,t,r)})}function C(e,t,n={}){n=G({size:{width:100}},n);var i=o.createText(t||"",n);return ev(i).add("djs-label"),ed(e,i),i}function P(e,t,n,i={}){var r=id(t),o=iK({x:t.x,y:t.y,width:t.width,height:t.height},i);return C(e,r.name,{align:n,box:o,padding:7,style:{fill:iW(t,l,c,i.stroke)}})}function A(e,t,n,i={}){var r=iM(n),o=C(e,t,{box:{height:30,width:r?iX(n,i):iY(n,i)},align:"center-middle",style:{fill:iW(n,l,c,i.stroke)}});r&&nt(o,0,-(-1*iX(n,i)),270)}function M(e,t,n={}){var{width:i,height:r}=iK(t,n);return m(e,i,r,10,{...n,fill:iV(t,s,n.fill),fillOpacity:.95,stroke:iG(t,c,n.stroke)})}function T(e,t,n={}){var i=id(t),r=iV(t,s,n.fill),o=iG(t,c,n.stroke);return("One"===i.get("associationDirection")||"Both"===i.get("associationDirection"))&&(n.markerEnd=d(e,"association-end",r,o)),"Both"===i.get("associationDirection")&&(n.markerStart=d(e,"association-start",r,o)),n=iQ(n,["markerStart","markerEnd"]),g(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"},5)}function B(e,t,n={}){var r,o,a=iV(t,s,n.fill),l=iG(t,c,n.stroke),p=y(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:a,fillOpacity:.95,stroke:l});return o=(r=id(t)).dataObjectRef,(r.isCollection||o&&o.isCollection)&&y(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:a,stroke:l}),p}function D(e,t,n={}){return f(e,t.width,t.height,{fillOpacity:.95,...n,fill:iV(t,s,n.fill),stroke:iG(t,c,n.stroke)})}function j(e,t,n={}){var i,r,o,a,l,u,h;return i=t.width,r=t.height,o={fill:iV(t,s,n.fill),fillOpacity:.95,stroke:iG(t,c,n.stroke)},u=[{x:a=i/2,y:0},{x:i,y:l=r/2},{x:a,y:r},{x:0,y:l}].map(function(e){return e.x+","+e.y}).join(" "),ed(e,h=ek("polygon",{...o=p(o),points:u})),h}function O(e,t,n={}){var i=m(e,iY(t,n),iX(t,n),0,{fill:iV(t,s,n.fill),fillOpacity:n.fillOpacity||.95,stroke:iG(t,c,n.stroke),strokeWidth:1.5}),r=id(t);return iu(r,"bpmn:Lane")&&A(e,r.get("name"),t,n),i}function N(e,t,n={}
9){var i=M(e,t,n),r=iA(t);if(iT(t)&&(eg(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!r)){var o,a,l,p,u,h,d=(id(t).flowElements||[]).filter(e=>iu(e,"bpmn:StartEvent"));1===d.length&&(o=d[0],a=e,l=n,u={fill:iV(p=t,s,l.fill),stroke:iG(p,c,l.stroke),width:22,height:22},h=id(o).isInterrupting,f(a,20,20,{fill:u.fill,stroke:u.stroke,strokeWidth:h?1:1.2,strokeDasharray:3*!h,transform:"translate(1,1)"}),E(o,a,u,p))}return P(e,t,r?"center-top":"center-middle",n),r?k(e,t,void 0,n):k(e,t,["SubProcessMarker"],n),i}function L(e,t,n={}){var i=M(e,t,n);return P(e,t,"center-middle",n),k(e,t,void 0,n),i}var $=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return n=iA(t)?iQ(n,["fill","stroke","width","height"]):iQ(n,["fill","stroke"]),N(e,t,n)},"bpmn:Association":function(e,t,n={}){return T(e,t,n=iQ(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=iQ(n,["fill","stroke"]);var r=id(t).get("cancelActivity");n={strokeWidth:1.5,fill:iV(t,s,n.fill),fillOpacity:1,stroke:iG(t,c,n.stroke)},r||(n.strokeDasharray="6");var o=D(e,t,n);return f(e,t.width,t.height,3,{...n,fill:"none"}),i&&E(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var r=L(e,t,n=iQ(n,["fill","stroke"]));return eg(y(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:1}),eg(y(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:iG(t,c,n.stroke),stroke:iG(t,c,n.stroke),strokeWidth:1}),r},"bpmn:CallActivity":function(e,t,n={}){return N(e,t,{strokeWidth:5,...n=iQ(n,["fill","stroke"])})},"bpmn:ComplexGateway":function(e,t,n={}){var r=j(e,t,n=iQ(n,["fill","stroke"]));return y(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:iG(t,c,n.stroke),stroke:iG(t,c,n.stroke),strokeWidth:1}),r},"bpmn:DataInput":function(e,t,n={}){n=iQ(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=B(e,t,n);return y(e,r,{fill:"none",stroke:iG(t,c,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return T(e,t,{...n=iQ(n,["fill","stroke"]),markerEnd:d(e,"association-end",iV(t,s,n.fill),iG(t,c,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return B(e,t,n=iQ(n,["fill","stroke"]))},"bpmn:DataObjectReference":_("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=iQ(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=B(e,t,n);return y(e,r,{strokeWidth:1,fill:iG(t,c,n.stroke),stroke:iG(t,c,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return T(e,t,{...n=iQ(n,["fill","stroke"]),markerEnd:d(e,"association-end",iV(t,s,n.fill),iG(t,c,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=iQ(n,["fill","stroke"]),y(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:iV(t,s,n.fill),fillOpacity:.95,stroke:iG(t,c,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:i=!0}=n,r=D(e,t,{...n=iQ(n,["fill","stroke"]),strokeWidth:4});return i&&E(t,e,n),r},"bpmn:EventBasedGateway":function(e,t,n={}){n=iQ(n,["fill","stroke"]);var r=id(t),o=j(e,t,n);f(e,t.width,t.height,.2*t.height,{fill:iV(t,"none",n.fill),stroke:iG(t,c,n.stroke),strokeWidth:1});var a=r.get("eventGatewayType"),s=!!r.get("instantiate");return"Parallel"===a?y(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:"none",stroke:iG(t,c,n.stroke),strokeWidth:1}):"Exclusive"===a&&(s||f(e,t.width,t.height,.26*t.height,{fill:"none",stroke:iG(t,c,n.stroke),strokeWidth:1}),y(e,i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}}),{fill:"none",stroke:iG(t,c,n.stroke),strokeWidth:2})),o},"bpmn:ExclusiveGateway":function(e,t,n={}){var r=j(e,t,n=iQ(n,["fill","stroke"])),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return im(t).get("isMarkerVisible")&&y(e,o,{fill:iG(t,c,n.stroke),stroke:iG(t,c,n.stroke),strokeWidth:1}),r},"bpmn:Gateway":function(e,t,n={}){return j(e,t,n=iQ(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=iQ(n,["fill","stroke","width","height"]),m(e,t.width,t.height,10,{stroke:iG(t,c,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:iY(t,n),height:iX(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var i=j(e,t,n=iQ(n,["fill","stroke"]));return f(e,t.width,t.height,.24*t.height,{fill:iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:2.5}),i},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:i=!0}=n,r=D(e,t,{...n=iQ(n,["fill","stroke"]),strokeWidth:1.5});return f(e,t.width,t.height,3,{fill:"none",stroke:iG(t,c,n.stroke),strokeWidth:1.5}),i&&E(t,e,n),r},"bpmn:IntermediateCatchEvent":_("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":_("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return O(e,t,{...n=iQ(n,["fill","stroke","width","height"]),fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var r=L(e,t,n=iQ(n,["fill","stroke"]));return y(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:.5}),r},"bpmn:MessageFlow":function(e,t,n={}){n=iQ(n,["fill","stroke"]);var r=id(t),o=im(t),a=iV(t,s,n.fill),l=iG(t,c,n.stroke),p=g(e,t.waypoints,{markerEnd:d(e,"messageflow-end",a,l),markerStart:d(e,"messageflow-start",a,l),stroke:l,strokeDasharray:"10, 11",strokeWidth:1.5},5);if(r.get("messageRef")){var u=p.getPointAtLength(p.getTotalLength()/2),h=i.get
9ScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),f={strokeWidth:1};"initiating"===o.get("messageVisibleKind")?(f.fill=a,f.stroke=l):(f.fill=l,f.stroke=a);var m=y(e,h,f),v=C(e,r.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:l}}),b=m.getBBox(),_=v.getBBox();nt(v,u.x-_.width/2,u.y+b.height/2+10,0)}return p},"bpmn:ParallelGateway":function(e,t,n={}){var r=j(e,t,n=iQ(n,["fill","stroke"]));return y(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:iG(t,c,n.stroke),stroke:iG(t,c,n.stroke),strokeWidth:1}),r},"bpmn:Participant":function(e,t,n={}){var i,r=O(e,t,n=iQ(n,["fill","stroke","width","height"])),o=iA(t),a=iM(t),s=id(t),p=s.get("name");if(o)g(e,a?[{x:30,y:0},{x:30,y:iX(t,n)}]:[{x:0,y:30},{x:iY(t,n),y:30}],{stroke:iG(t,c,n.stroke),strokeWidth:1.5}),A(e,p,t,n);else{var u=iK(t,n);a||(u.height=iY(t,n),u.width=iX(t,n));var h=C(e,p,{box:u,align:"center-middle",style:{fill:iW(t,l,c,n.stroke)}});a||nt(h,0,-(-1*iX(t,n)),270)}return s.get("participantMultiplicity")&&(i=n,S.ParticipantMultiplicityMarker(e,t,i)),r},"bpmn:ReceiveTask":function(e,t,n={}){n=iQ(n,["fill","stroke"]);var r,o=id(t),a=L(e,t,n);return o.get("instantiate")?(f(e,28,28,4.4,{fill:iV(t,s,n.fill),stroke:iG(t,c,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}}),y(e,r,{fill:iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:1}),a},"bpmn:ScriptTask":function(e,t,n={}){var r=L(e,t,n=iQ(n,["fill","stroke"]));return y(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:1}),r},"bpmn:SendTask":function(e,t,n={}){var r=L(e,t,n=iQ(n,["fill","stroke"]));return y(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:iG(t,c,n.stroke),stroke:iV(t,s,n.fill),strokeWidth:1}),r},"bpmn:SequenceFlow":function(e,t,n={}){var i=iV(t,s,(n=iQ(n,["fill","stroke"])).fill),r=iG(t,c,n.stroke),o=g(e,t.waypoints,{markerEnd:d(e,"sequenceflow-end",i,r),stroke:r},5),a=id(t),{source:l}=t;if(l){var p=id(l);a.get("conditionExpression")&&iu(p,"bpmn:Activity")&&eg(o,{markerStart:d(e,"conditional-flow-marker",i,r)}),p.get("default")&&(iu(p,"bpmn:Gateway")||iu(p,"bpmn:Activity"))&&p.get("default")===a&&eg(o,{markerStart:d(e,"conditional-default-flow-marker",i,r)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var r=L(e,t,n=iQ(n,["fill","stroke"]));return f(e,10,10,{fill:iV(t,s,n.fill),stroke:"none",transform:"translate(6, 6
9)"}),y(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:1}),f(e,10,10,{fill:iV(t,s,n.fill),stroke:"none",transform:"translate(11, 10)"}),y(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:1}),r},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=iQ(n,["fill","stroke"]),id(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var r=D(e,t,n);return i&&E(t,e,n),r},"bpmn:SubProcess":function(e,t,n={}){return n=iA(t)?iQ(n,["fill","stroke","width","height"]):iQ(n,["fill","stroke"]),N(e,t,n)},"bpmn:Task":function(e,t,n={}){return L(e,t,n=iQ(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){var{width:r,height:o}=iK(t,n=iQ(n,["fill","stroke"])),a=m(e,r,o,0,0,{fill:"none",stroke:"none"});return y(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:0,my:0}}),{stroke:iG(t,c,n.stroke)}),C(e,id(t).get("text")||"",{align:"left-top",box:iK(t,n),padding:7,style:{fill:iW(t,l,c,n.stroke)}}),a},"bpmn:Transaction":function(e,t,i={}){i=iA(t)?iQ(i,["fill","stroke","width","height"]):iQ(i,["fill","stroke"]);var r=N(e,t,{strokeWidth:1.5,...i}),o=n.style(["no-fill","no-events"],{stroke:iG(t,c,i.stroke),strokeWidth:1.5});return iA(t)||(i={}),m(e,iY(t,i),iX(t,i),7,3,o),r},"bpmn:UserTask":function(e,t,n={}){var r=L(e,t,n=iQ(n,["fill","stroke"]));return y(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:.5}),y(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:iV(t,s,n.fill),stroke:iG(t,c,n.stroke),strokeWidth:.5}),y(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:iG(t,c,n.stroke),stroke:iG(t,c,n.stroke),strokeWidth:.5}),r},label:function(e,t,n={}){return function(e,t,n={}){var i={width:t.width,height:t.height,x:t.width/2+t.x,y:t.height/2+t.y};return C(e,i$(t),{box:i,style:G({},o.getExternalStyle(),{fill:iW(t,l,c,n.stroke)})})}(e,t,n)}};this._drawPath=y,this._renderer=function(e){return $[e]}}function iQ(e,t=[]){return t.reduce((t,n)=>(e[n]&&(t[n]=e[n]),t),{})}i(iJ,eW),iJ.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],iJ.prototype.canRender=function(e){return iu(e,"bpmn:BaseElement")},iJ.prototype.drawShape=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},iJ.prototype.drawConnection=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},iJ.prototype.getShapePath=function(e){var t,n,i,r,o,a,s,c,l;return tM(e)?iq(e,4):iu(e,"bpmn:Event")?iU(e):iu(e,"bpmn:Activity")?iq(e,10):iu(e,"bpmn:Gateway")?(t=e.width,n=e.height,i=e.x,r=e.y,eU([["M",i+(o=t/2),r],["l",o,a=n/2],["l",-o,a],["l",-o,-a],["z"]])):(s=e.x,c=e.y,eU([["M",s,c],["l",l=e.width,0],["l",0,e.height],["l",-l,0],["z"]]))};var i0={width:150,height:50},i1=null;function i2(e){if(null!=e)return"number"==typeof e||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function i5(e){this._config=G({},{size:i0,padding:0,style:{},align:"center-top"},e||{})}function i3(e){var t=G({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=G({},t,{fontSize:n},e&&e.externalStyle||{}),r=new i5({style:t});function o(e,t,n){return r.getDimensions(e,G({box:t},n))}this.getExternalLabelBounds=function(e,t){var n=o(t,{width:Math.max(e.width,iD.width),height:30},{style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:e.y,width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=o(n,e,{style:t,align:"left-top",padding:7});return{x:e.x,y:e.y,width:e.width,height:Math.max(40,Math.round(i.height))}},this.getDimensions=function(e,t){return r.getDimensions(e,t||{})},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}i5.prototype.createText=function(e,t){return this.layoutText(e,t).element},i5.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},i5.prototype.layoutText=function(e,t){for(var n,i,r=G({},this._config.size,t.box),o=G({},this._config.style,t.style),a={horizontal:(n=(t.align||this._config.align).split("-"))[0]||"center",vertical:n[1]||"top"},s=b(i=void 0!==t.padding?t.padding:this._config.padding)?G({top:0,left:0,right:0,bottom:0},i):{top:i,left:i,right:i,bottom:i},c=t.fitBox||!1,l=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(o),p=e.split(/\u00AD?\r?\n/),u=[],h=r.width-s.left-s.right;p.length;)u.push(function(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=function(e,t){var n,i=(i1||(i1=document.createElement("canvas").getContext("2d")),i1);if(!i)return{width:0,height:0};n=[],t.fontStyle&&n.push(t.fontStyle),t.fontVariant&&n.push(t.fontVariant),t.fontWeight&&n.push(t.fontWeight),t.fontStretch&&n.push(t.fontStretch),n.push(i2(t.fontSize)||"12px"),n.push(t.fontFamily||"sans-serif"),i.font=n.join(" "),"letterSpacing"in i&&(i.letterSpacing=i2(t.letterSpacing)||"0px");var r=""===e,o=r?"dummy":e.replace(/\s+$/,""),a=i.measureText(o);return{width:r?0:a.width,height:"fontBoundingBoxAscent"in a?a.fontBoundingBoxAscent+a.fontBoundingBoxDescent:a.actualBoundingBoxAscent+a.actualBoundingBoxDescent}}
9(o,n)).width=o?i.width:0," "===o||""===o||i.width<=t||o.length<2)return function(e,t,n,i){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:i.width,height:i.height,text:t}}(e,o,r,i);o=function(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(e,t){var n,i=e.split(/(\s|-|\u00AD)/g),r=[],o=0;if(i.length>1)for(;n=i.shift();)if(n.length+o<t)r.push(n),o+=n.length;else{("-"===n||"Â"===n)&&r.pop();break}var a=r[r.length-1];return a&&"Â"===a&&(r[r.length-1]="-"),r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}(o,i.width,t)}}(p,h,o));"middle"===a.vertical&&(s.top=s.bottom=0);var d=P(u,function(e,t,n){return e+(l||t.height)},0)+s.top+s.bottom,f=P(u,function(e,t,n){return t.width>e?t.width:e},0),m=s.top;"middle"===a.vertical&&(m+=(r.height-d)/2),m-=(l||u[0].height)/4;var g=ek("text");return eg(g,o),R(u,function(e){switch(m+=l||e.height,a.horizontal){case"left":t=s.left;break;case"right":t=(c?f:h)-s.right-e.width;break;default:t=Math.max(((c?f:h)-e.width)/2+s.left,0)}var t,n=ek("tspan");eg(n,{x:t,y:m}),n.textContent=e.text,ed(g,n)}),{dimensions:{width:f,height:d},element:g}},i3.$inject=["config.textRenderer"];var i6=/\{([^{}]+)\}/g,i9=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;let i4={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(e,n){return t[n]||"{"+n+"}"})}]};function i8(e,t,n){return G({id:e.id,type:e.$type,businessObject:e,di:t},n)}function i7(e,t,n){return Error(`element ${ic(t)} referenced by ${ic(e)}#${n} not yet drawn`)}function re(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._textRenderer=r}function rt(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}re.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],re.prototype.add=function(e,t,n){if(iu(t,"bpmndi:BPMNPlane")){var i,r,o,a=iu(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(i8(e,t,a)),this._canvas.addRootElement(i)}else if(iu(t,"bpmndi:BPMNShape")){var s,c,l,p,u=!iA(e,t),h=iu(e,"bpmn:Group");r=n&&(n.hidden||n.collapsed);var d=t.bounds;i=this._elementFactory.createShape(i8(e,t,{collapsed:u,hidden:r,x:Math.round(d.x),y:Math.round(d.y),width:Math.round(d.width),height:Math.round(d.height),isFrame:h})),iu(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),iu(e,"bpmn:Lane")&&(o=0),!iu(e,"bpmn:DataStoreReference")||(s=n,l=(c=tO(d)).x,p=c.y,l>=s.x&&l<=s.x+s.width&&p>=s.y&&p<=s.y+s.height)||(n=this._canvas.findRoot(n)),this._canvas.addShape(i,n,o)}else if(iu(t,"bpmndi:BPMNEdge")){var f,m=this._getSource(e),g=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(i8(e,t,{hidden:r,source:m,target:g,waypoints:(f=t.waypoint)&&!(f.length<2)?f.map(function(e){return{x:e.x,y:e.y}}):[tO(m),tO(g)]})),iu(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}else throw Error(`unknown di ${ic(t)} for element ${ic(e)}`);return ij(e)&&i$(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},re.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw Error(`missing ${ic(e)}#attachedToRef`);var i=this._elementRegistry.get(n.id),r=i&&i.attachers;if(!i)throw i7(e,n,"attachedToRef");t.host=i,r||(i.attachers=r=[]),-1===r.indexOf(t)&&r.push(t)},re.prototype.addLabel=function(e,t,n){var i,r,o,a,s,c,l;return(l=t.label)&&l.bounds?(c=l.bounds,s={width:Math.max(iD.width,c.width),height:c.height},a={x:c.x+c.width/2,y:c.y+c.height/2}):(a=iN(n),s=iD),i=G({x:a.x-s.width/2,y:a.y-s.height/2},s),(r=i$(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(i8(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!i$(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)},re.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type;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;if(i)throw i7(e,i,t+"Ref");throw Error(`${ic(e)}#${t} Ref not specified`)},re.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},re.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},re.prototype._getElement=function(e){return this._elementRegistry.get(e.id)},rt.prototype.next=function(){return this._prefix+ ++this._counter};var rn=new rt("ov");function ri(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=rn,this._overlayDefaults=G({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),q(o=eu('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}
vendor: 4,987 bytes, line 9
9function rr(e,t,n){q(e,{left:t+"px",top:n+"px"})}function ro(e,t){e.style.display=!1===t?"none":""}function ra(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}ri.$inject=["config.overlays","eventBus","canvas","elementRegistry"],ri.prototype.get=function(e){if(w(e)&&(e={id:e}),w(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?C(t.overlays,L({type:e.type})):t.overlays.slice():[]}return e.type?C(this._overlays,L({type:e.type})):e.id?this._overlays[e.id]:null},ri.prototype.add=function(e,t,n){if(b(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw Error("must specifiy overlay position");if(!n.html)throw Error("must specifiy overlay html");if(!e)throw Error("invalid element specified");var i=this._ids.next();return n=G({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},ri.prototype.remove=function(e){var t=this.get(e)||[];v(t)||(t=[t]);var n=this;R(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(el(e.html),el(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)}})},ri.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},ri.prototype.show=function(){ro(this._overlayRoot)},ri.prototype.hide=function(){ro(this._overlayRoot,!1)},ri.prototype.clear=function(){this._overlays={},this._overlayContainers=[],J(this._overlayRoot)},ri.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=e2(t);i=o.x,r=o.y}rr(n,i,r),K(e.html,"data-container-id",t.id)},ri.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?e2(o).width:o.width,a=-1*i.right+t),void 0!==i.bottom&&(n=o.waypoints?e2(o).height:o.height,s=-1*i.bottom+n),rr(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},ri.prototype._createOverlayContainer=function(e){var t=eu('<div class="djs-overlays" />');q(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},ri.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";ra(this._overlayRoot,n)},ri.prototype._getOverlayContainer=function(e,t){var n=S(this._overlayContainers,function(t){return t.element===e});return n||t?n:this._createOverlayContainer(e)},ri.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)),w(o)&&(o=eu(o)),n=this._getOverlayContainer(r),q(t=eu('<div class="djs-overlay" data-overlay-id="'+i+'">'),{position:"absolute"}),t.appendChild(o),e.type&&X(t).add("djs-overlay-"+e.type),ro(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())},ri.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=this._canvas.getRootElement(),c=!0;i!==s?c=!1:n&&(g(r)&&r>t.scale||g(o)&&o<t.scale)&&(c=!1),ro(a,c),this._updateOverlayScale(e,t)},ri.prototype._updateOverlayScale=function(e,t){var n,i,r,o=e.scale,a=e.htmlContainer,s="";!0!==o&&(!1===o?(n=1,i=1):(n=o.min,i=o.max),g(n)&&t.scale<n&&(r=(1/t.scale||1)*n),g(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),g(r)&&(s="scale("+r+","+r+")"),ra(a,s)},ri.prototype._updateOverlaysVisibilty=function(e){var t=this;R(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},ri.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;R(t.get({element:n}),function(e){t.remove(e.id)});var i=t._getOverlayContainer(n);if(i){el(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&&(R(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&&X(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)};let rs={__init__:["overlays"],overlays:["type",ri]};function rc(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(e3(r)+".changed",i)}),e.on("elements.changed",function(t){var n=t.elements;
9n.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)})}rc.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];let rl={__init__:["changeSupport"],changeSupport:["type",rc]};function rp(e){this._eventBus=e}function ru(e){return function(t,n,i,r,o){(x(t)||_(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function rh(e,t){t.invoke(rp,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)})}function rd(e){return CSS.escape(e)}rp.$inject=["eventBus"],rp.prototype.on=function(e,t,n,i,r,o){if((x(t)||_(t))&&(o=r,r=i,i=n,n=t,t=null),x(n)&&(o=r,r=i,i=n,n=1e3),b(r)&&(o=r,r=!1),!x(i))throw Error("handlerFn must be a function");v(e)||(e=[e]);var a=this._eventBus;R(e,function(e){var s,c,l=["commandStack",e,t].filter(function(e){return e}).join(".");a.on(l,n,r?(s=i,c=o,function(e){return s.call(c||null,e.context,e.command,e)}):i,o)})},rp.prototype.canExecute=ru("canExecute"),rp.prototype.preExecute=ru("preExecute"),rp.prototype.preExecuted=ru("preExecuted"),rp.prototype.execute=ru("execute"),rp.prototype.executed=ru("executed"),rp.prototype.postExecute=ru("postExecute"),rp.prototype.postExecuted=ru("postExecuted"),rp.prototype.revert=ru("revert"),rp.prototype.reverted=ru("reverted"),i(rh,rp),rh.$inject=["canvas","injector"];var rf={"&":"&","<":"<",">":">",'"':""","'":"'"};function rm(e){return(e=""+e)&&e.replace(/[&<>"']/g,function(e){return rf[e]})}var rg="_plane";function ry(e){var t=e.id;return iu(e,"bpmn:SubProcess")?t+rg:t}function rv(e){return iu(im(e),"bpmndi:BPMNPlane")}function rb(e){return e.replace(RegExp(rg+"$"),"")}function r_(e,t,n){var i=eu('<ul class="bjs-breadcrumbs"></ul>'),r=n.getContainer(),o=X(r);r.appendChild(i);var a=[];function s(e){e&&(a=function(e){for(var t=id(e),n=[],i=t;i;i=i.$parent)(iu(i,"bpmn:SubProcess")||iu(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var r=a.flatMap(function(e){var i=n.findRoot(ry(e))||n.findRoot(e.id);if(!i&&iu(e,"bpmn:Process")){var r=t.find(function(t){var n=id(t);return n&&n.get("processRef")===e});i=r&&n.findRoot(r.id)}return i?[{parent:e,parentPlane:i}]:[]});i.innerHTML="";var s=r.length>1;o.toggle("bjs-breadcrumbs-shown",s),r.forEach(function(e,t){var o,a=e.parent,s=e.parentPlane,c=rm(a.name||a.id);t===r.length-1?o=eu('<li><span class="bjs-crumb" title="'+c+'">'+c+"</span></li>"):(o=eu('<li><a class="bjs-crumb" href="#'+rm(a.id)+'" title="'+c+'">'+c+"</a></li>")).addEventListener("click",function(e){e.preventDefault(),n.setRootElement(s)}),i.appendChild(o)})}e.on("element.changed",function(e){var t=id(e.element);S(a,function(e){return e===t})&&s()}),e.on("root.set",function(e){s(e.element)})}function rx(e,t){var n=null,i=new rw;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,iu(r,"bpmn:SubProcess")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,c=(o.y-a.y)*o.scale;(0!==s||0!==c)&&t.scroll({dx:s,dy:c}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){i.clear(),n=null})}function rw(){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)}}r_.$inject=["eventBus","elementRegistry","canvas"],rx.$inject=["eventBus","canvas"];function rE(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 rS(e,t,n,i,r){rp.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i,this._translate=r;var o=this;this.executed("shape.toggleCollapse",250,function(e){var t=e.shape;o._canDrillDown(t)?o._addOverlay(t):o._removeOverlay(t)},!0),this.reverted("shape.toggleCollapse",250,function(e){var t=e.shape;o._canDrillDown(t)?o._addOverlay(t):o._removeOverlay(t)},!0),this.executed(["shape.create","shape.move","shape.delete"],250,function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;o._canDrillDown(i)&&o._addOverlay(i),o._updateDrilldownOverlay(t),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(i)},!0),this.reverted(["shape.create","shape.move","shape.delete"],250,function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;o._canDrillDown(i)&&o._addOverlay(i),o._updateDrilldownOverlay(t),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(i)},!0),t.on("import.render.complete",function(){n.filter(function(e){return o._canDrillDown(e)}).map(function(e){o._addOverlay(e)})})}function rk(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function rC(e){return e.originalEvent||e.srcEvent}function rR(e){rk(e),rk(rC(e))}function rP(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 rA(){return/mac/i.test(navigator.platform)}function rM(e,t){return(rC(e)||e).button===t}function rT(e){return rM(e,0)}function rB(e){var t=rC(e)||e;return!!rT(e)&&(rA()?t.metaKey:t.ctrlKey)}function rD(e){var t=rC(e)||e;return rT(e)&&t.shiftKey}function rj(e){return!0}function rO(e){return rT(e)||rM(e,1)}function rN(e,t,n){var i=this;function r(n,i,r){var o,a,c,l;c=n,l=i,!(s[c]||rT)(l)||(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={},a={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},s={"element.contextmenu":rj,"element.mousedown":rO,"element.mouseup":rO,"element.click":rO,"element.dblclick":rO};function c(e,t,n,i){var a=o[n]=function(e){r(n,e)};i&&(s[n]=i),a.$delegate=er(e,"svg, .djs-element",t,a)}function l(e,t,n){var i=o[n];i&&eo(e,t,i.$delegate)}e.on("canvas.destroy",function(e){var t;t=e.svg,R(a,function(e,n){l(t,n,e)})}),e.on("canvas.init",function(e){var t;
9t=e.svg,R(a,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 p=d("djs-hit djs-hit-stroke"),u=d("djs-hit djs-hit-click-stroke"),h={all:d("djs-hit djs-hit-all"),"click-stroke":u,stroke:p,"no-move":d("djs-hit djs-hit-no-move")};function d(e,t){return t=G({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function f(e,t){var n=h[t];if(!n)throw Error("invalid hit type <"+t+">");return eg(e,n),e}this.removeHits=function(e){R(ec(".djs-hit",e),eO)},this.createDefaultHit=function(e,t){var n=e.waypoints,i=e.isFrame;return n?this.createWaypointsHit(t,n):this.createBoxHit(t,i?"stroke":"all",{width:e.width,height:e.height})},this.createWaypointsHit=function(e,t){var n=eX(t);return f(n,"stroke"),ed(e,n),n},this.createBoxHit=function(e,t,n){n=G({x:0,y:0},n);var i=ek("rect");return f(i,t),eg(i,n),ed(e,i),i},this.updateDefaultHit=function(e,t){var n=es(".djs-hit",t);if(n)return e.waypoints?eZ(n,e.waypoints):eg(n,{width:e.width,height:e.height}),n},this.fire=r,this.triggerMouseEvent=function(e,t,n){var i=a[e];if(!i)throw Error("unmapped DOM event name <"+e+">");return r(i,t,n)},this.mouseHandler=function(e){return o[e]},this.registerEvent=c,this.unregisterEvent=l}rE.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)}),e.diagrams.filter(e=>e.plane).flatMap(e=>t._createNewDiagrams(e.plane)).forEach(function(e){t._movePlaneElementsToOrigin(e.plane)})}},rE.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach(function(t){var r=t.bpmnElement;if(r){var o,a,s,c=r.$parent;iu(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),o=r,a=e,!iu(s=o.$parent,"bpmn:SubProcess")||s===a.bpmnElement||ih(o,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"])||i.push({diElement:t,parent:c})}});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)}}
9),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},rE.prototype._movePlaneElementsToOrigin=function(e){var t,n=e.get("planeElement"),i=(t={top:1/0,right:-1/0,bottom:-1/0,left:1/0},e.planeElement.forEach(function(e){if(e.bounds){var n=tD(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}}),tj(t)),r={x:i.x-180,y:i.y-160};n.forEach(function(e){e.waypoint?e.waypoint.forEach(function(e){e.x=e.x-r.x,e.y=e.y-r.y}):e.bounds&&(e.bounds.x=e.bounds.x-r.x,e.bounds.y=e.bounds.y-r.y)})},rE.prototype._moveToDiPlane=function(e,t){var n=(function e(t){return iu(t,"bpmndi:BPMNDiagram")?t:e(t.$parent)})(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},rE.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},rE.$inject=["eventBus","moddle"],i(rS,rp),rS.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},rS.prototype._canDrillDown=function(e){var t=this._canvas;return iu(e,"bpmn:SubProcess")&&t.findRoot(ry(e))},rS.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=id(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;X(i.html).toggle("bjs-drilldown-empty",!r)}},rS.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,i=id(e);n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var r=eu('<button type="button" class="bjs-drilldown"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg></button>'),o=i.get("name")||i.get("id"),a=this._translate("Open {element}",{element:o});r.setAttribute("title",a),r.addEventListener("click",function(){t.setRootElement(t.findRoot(ry(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:r}),this._updateOverlayVisibility(e)},rS.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},rS.$inject=["canvas","eventBus","elementRegistry","overlays","translate"],rN.$inject=["eventBus","elementRegistry","styles"];let rL={__init__:["interactionEvents"],interactionEvents:["type",rN]};function r$(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=new Set;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)})}r$.$inject=["eventBus","canvas"],r$.prototype.deselect=function(e){if(this._selectedElements.has(e)){var t=this.get();this._selectedElements.delete(e),this._eventBus.fire("selection.changed",{oldSelection:t,newSelection:this.get()})}},r$.prototype.get=function(){return Array.from(this._selectedElements)},r$.prototype.isSelected=function(e){return this._selectedElements.has(e)},r$.prototype.select=function(e,t){var n=this.get();v(e)||(e=e?[e]:[]);var i=this._canvas,r=i.getRootElement();e=e.filter(function(e){return r===i.findRoot(e)}),t?R(e,e=>{this._selectedElements.add(e)}):this._selectedElements=new Set(e),this._eventBus.fire("selection.changed",{oldSelection:n,newSelection:this.get()})};var rI="hover",rF="selected";function rz(e,t){function n(t,n){e.addMarker(t,n)}function i(t,n){e.removeMarker(t,n)}this._canvas=e,t.on("element.hover",function(e){n(e.element,rI)}),t.on("element.out",function(e){i(e.element,rI)}),t.on("selection.changed",function(e){var t=new Set(e.oldSelection),r=new Set(e.newSelection);for(let e of t)r.has(e)||i(e,rF);for(let e of r)t.has(e)||n(e,rF)})}function rH(e,t,n,i){e.on("create.end",500,function(e){var n=e.context,i=n.
9canExecute,r=n.elements,o=(n.hints||{}).autoSelect;if(i){if(!1===o)return;v(o)?t.select(o):t.select(r.filter(rV))}}),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);S(n,function(e){return r.id===e.id})||t.select(r)}),e.on("element.click",function(e){if(rT(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=rD(e);if(r&&o)if(a)return t.deselect(i);else return t.select(i);r?t.deselect(i):t.select(i,a)}})}function rV(e){return!e.hidden}rz.$inject=["canvas","eventBus"],rH.$inject=["eventBus","selection","canvas","elementRegistry"];let rG={__init__:["selectionVisuals","selectionBehavior"],__depends__:[rL],selection:["type",r$],selectionVisuals:["type",rz],selectionBehavior:["type",rH]};function rW(e){iS.call(this,e)}function rU(e,t,n){this._selectionWasVisible=!1;let i=H(()=>{this._selectionWasVisible=r()},300);function r(){var e=n.get();if(!e.length)return!1;var i=e2(e),r=t.viewbox(),o=tD(i),a=tD(r);return o.left>=a.left&&o.right<=a.right&&o.top>=a.top&&o.bottom<=a.bottom}e.on("canvas.viewbox.changed",i),e.on("selection.changed",i),e.on("diagram.destroy",()=>{i.cancel()}),e.on("canvas.resized",()=>{var e=n.get();if(e.length&&this._selectionWasVisible&&!r()){var i=t.getRootElement();t.scrollToElement(e.concat(i))}}),this._flush=i.flush}i(rW,iS),rW.prototype._modules=[{__depends__:[{__init__:["bpmnRenderer"],bpmnRenderer:["type",iJ],textRenderer:["type",i3
vendor: 10,291 bytes, line 9
9],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
9,o,a=this.pathMap[e];t.abspos?(r=t.abspos.x,o=t.abspos.y):(r=t.containerWidth*t.position.mx,o=t.containerHeight*t.position.my);var s={};if(t.position){for(var c=t.containerHeight/a.height*t.yScaleFactor,l=t.containerWidth/a.width*t.xScaleFactor,p=0;p<a.heightElements.length;p++)s["y"+p]=a.heightElements[p]*c;for(var u=0;u<a.widthElements.length;u++)s["x"+u]=a.widthElements[u]*l}return n=a.d,i={mx:r,my:o,e:s},String(n).replace(i6,function(e,t){var n;return n=i,t.replace(i9,function(e,t,i,r,o){t=t||r,n&&(t in n&&(n=n[t]),"function"==typeof n&&o&&(n=n()))}),n=(null==n||n==i?e:n)+""})}}]},{__depends__:[i4],bpmnImporter:["type",re]}]},{__depends__:[rs,rl,{__init__:["rootElementsBehavior"],rootElementsBehavior:["type",rh]}],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",r_],drilldownCentering:["type",rx],drilldownOverlayBehavior:["type",rS],subprocessCompatibility:["type",rE]},rs,rG,i4],rW.prototype._moddleExtensions={},rU.$inject=["eventBus","canvas","selection"];let rq={__init__:["keepSelectionVisible"],__depends__:[rG],keepSelectionVisible:["type",rU]};var rK=["c","C"],rY=["v","V"],rX=["d","D"],rZ=["x","X"],rJ=["y","Y"],rQ=["z","Z"];function r0(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function r1(e,t){return -1!==(e=v(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.code)}function r2(e){return e.shiftKey}var r5="keyboard.keydown",r3="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function r6(e,t){var n=this;this._config=e=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()}),e.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",Error(r3));var i=e&&!1!==e.bind;t.on("canvas.init",function(e){n._target=e.svg,i&&n.bind(),n._fire("init")})}function r9(e,t){var n=this;e.on("editorActions.init",500,function(e){var i=e.editorActions;n.registerBindings(t,i)})}r6.$inject=["config.keyboard","eventBus"],r6.prototype._keydownHandler=function(e){this._keyHandler(e,r5)},r6.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},r6.prototype._keyHandler=function(e,t){!this._isEventIgnored(e)&&this._eventBus.fire(t||r5,{keyEvent:e})&&e.preventDefault()},r6.prototype._isEventIgnored=function(e){return!1},r6.prototype.bind=function(e){e&&console.error("unsupported argument <node>",Error(r3)),this.unbind(),e=this._node=this._target,en.bind(e,"keydown",this._keydownHandler),en.bind(e,"keyup",this._keyupHandler),this._fire("bind")},r6.prototype.getBinding=function(){return this._node},r6.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),en.unbind(e,"keydown",this._keydownHandler),en.unbind(e,"keyup",this._keyupHandler)),this._node=null},r6.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},r6.prototype.addListener=function(e,t,n){x(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||r5,e,t)},r6.prototype.removeListener=function(e,t){this._eventBus.off(t||r5,e)},r6.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},r6.prototype.isCmd=r0,r6.prototype.isShift=r2,r6.prototype.isKey=r1,r9.$inject=["eventBus","keyboard"],r9.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",function(e){var n;
9if(r0(n=e.keyEvent)&&!r2(n)&&r1(rQ,n))return t.trigger("undo"),!0}),n("redo",function(e){var n;if(r0(n=e.keyEvent)&&(r1(rJ,n)||r1(rQ,n)&&r2(n)))return t.trigger("redo"),!0}),n("copy",function(e){var n;if(r0(n=e.keyEvent)&&r1(rK,n))return t.trigger("copy"),!0}),n("paste",function(e){var n;if(r0(n=e.keyEvent)&&r1(rY,n))return t.trigger("paste"),!0}),n("duplicate",function(e){var n;if(r0(n=e.keyEvent)&&r1(rX,n))return t.trigger("duplicate"),!0}),n("cut",function(e){var n;if(r0(n=e.keyEvent)&&r1(rZ,n))return t.trigger("cut"),!0}),n("stepZoom",function(e){var n=e.keyEvent;if(r1(["+","Add","="],n)&&r0(n))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(e){var n=e.keyEvent;if(r1(["-","Subtract"],n)&&r0(n))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(e){var n=e.keyEvent;if(r1("0",n)&&r0(n))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(e){if(r1(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0})};let r4={__init__:["keyboard","keyboardBindings"],keyboard:["type",r6],keyboardBindings:["type",r9]};var r8={moveSpeed:50,moveSpeedAccelerated:200};function r7(e,t,n){var i=this;this._config=G({},r8,e||{}),t.addListener(function(e){var n=e.keyEvent,r=i._config;if(t.isCmd(n)&&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})}}r7.$inject=["config.keyboardMove","keyboard","canvas"];let oe={__depends__:[r4],__init__:["keyboardMove"],keyboardMove:["type",r7]};var ot=/^djs-cursor-.*$/;function on(e){var t=X(document.body);t.removeMatching(ot),e&&t.add("djs-cursor-"+e)}function oi(e,t){function n(){return!1}return t=t||"element.click",e.once(t,5e3,n),function(){e.off(t,n)}}function or(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function oo(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oa(e,t){var n;function i(e){var t=e.originalEvent;if(!Q(t.target,".djs-draggable")){var i=t.button;if(!(i>=2)&&!t.ctrlKey&&!t.shiftKey&&!t.altKey)return n={button:i,start:rP(t)},en.bind(document,"mousemove",r),en.bind(document,"mouseup",o),!0}}function r(i){var r,o=n.start,a=n.button,s=rP(i),c=oo(s,o);!n.dragging&&Math.sqrt(Math.pow((r=c).x,2)+Math.pow(r.y,2))>15&&(n.dragging=!0,0===a&&oi(e),on("grab")),n.dragging&&(c=oo(s,n.last||n.start),t.scroll({dx:c.x,dy:c.y}),n.last=s),i.preventDefault()}function o(e){en.unbind(document,"mousemove",r),en.unbind(document,"mouseup",o),n=null,on(null)}e.on("canvas.focus.changed",function(t){t.focused?e.on("element.mousedown",500,i):e.off("element.mousedown",i)}),this.isActive=function(){return!!n}}oa.$inject=["eventBus","canvas"];let os={__init__:["moveCanvas"],moveCanvas:["type",oa]};function oc(e){return Math.log(e)/Math.log(10)}function ol(e,t){return(Math.abs(oc(e.min))+Math.abs(oc(e.max)))/t}var op=Math.sign||function(e){return e>=0?1:-1},ou={min:.2,max:4};function oh(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||.75;var i=this;t.on("canvas.mouseover",function(){i._init(!1!==e.enabled)}),t.on("canvas.mouseout",function(){i._init(!1)})}oh.$inject=["config.zoomScroll","eventBus","canvas"],oh.prototype.scroll=function(e){this._canvas.scroll(e)},oh.prototype.reset=function(){this._canvas.zoom("fit-viewport")},oh.prototype.zoom=function(e,t){var n=ol(ou,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},oh.prototype._handleWheel=function(e){if(this._enabled){var t=this._container;e.preventDefault();var n,i=e.ctrlKey||rA()&&e.metaKey,r=e.shiftKey,o=-1*this._scale;
9if(i?o*=0===e.deltaMode?.02:.32:o*=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))*op(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)}},oh.prototype.stepZoom=function(e,t){var n=ol(ou,10);this._zoom(e,t,n)},oh.prototype._zoom=function(e,t,n){var i=this._canvas,r=Math.round(oc(i.zoom())/n)*n,o=Math.pow(10,r+=n*(e>0?1:-1));i.zoom(Math.max(ou.min,Math.min(ou.max,o)),t)},oh.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&en[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},oh.prototype._init=function(e){this.toggle(e)};let od={__init__:["zoomScroll"],zoomScroll:["type",oh]};function of(e){rW.call(this,e)}function om(e){return e&&e[e.length-1]}function og(e){return e.y}function oy(e){return e.x}i(of,rW),of.prototype._navigationModules=[rq,oe,os,od],of.prototype._modules=[].concat(rW.prototype._modules,of.prototype._navigationModules);var ov={left:oy,center:oy,right:function(e){return e.x+e.width},top:og,middle:og,bottom:function(e){return e.y+e.height}};function ob(e,t){this._modeling=e,this._rules=t}ob.$inject=["modeling","rules"],ob.prototype._getOrientationDetails=function(e){var t="x",n="width";return -1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},ob.prototype._isType=function(e,t){return -1!==t.indexOf(e)},ob.prototype._alignmentPosition=function(e,t){var n,i,r,o,a=this._getOrientationDetails(e),s=a.axis,c=a.dimension,l={},p={},u=!1;if(this._isType(e,["left","top"]))l[e]=t[0][s];else if(this._isType(e,["right","bottom"]))o=om(t),l[e]=o[s]+o[c];else if(this._isType(e,["center","middle"])){if(R(t,function(e){var t=e[s]+Math.round(e[c]/2);p[t]?p[t].elements.push(e):p[t]={elements:[e],center:t}}),i=N(p,function(e){return e.elements.length>1&&(u=!0),e.elements.length}),u)return l[e]=om(i).center,l;r=t[0],o=om(t=N(t,function(e){return e[s]+e[c]})),l[e]=(n=o,Math.round((r[s]+n[s]+n[c])/2))}return l},ob.prototype.trigger=function(e,t){var n,i=this._modeling,r=C(e,function(e){return!(e.waypoints||e.host||e.labelTarget)});if(v(n=this._rules.allowed("elements.align",{elements:r}))&&(r=n),!(r.length<2)&&n){var o=N(r,ov[t]),a=this._alignmentPosition(t,o);i.alignElements(o,a)}};let o_=new rt;function ox(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(e=>{this.cancel(e)})})}ox.$inject=["eventBus"],ox.prototype.schedule=function(e,t=o_.next()){this.cancel(t);let n=this._schedule(e,t);return this._scheduled[t]=n,n.promise},ox.prototype._schedule=function(e,t){let n,i=((n={}).promise=new Promise((e,t)=>{n.resolve=e,n.reject=t}),n);return{executionId:setTimeout(()=>{try{this._scheduled[t]=null;try{i.resolve(e())}catch(e){i.reject(e)}}catch(e){console.error("Scheduler#_schedule execution failed",e)}}),promise:i.promise}},ox.prototype.cancel=function(e){let t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)},ox.prototype._cancel=function(e){clearTimeout(e.executionId)};var ow=".entry";function oE(e,t,n,i){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=i,this._current=null,this._init()}oE.$inject=["canvas","elementRegistry","eventBus","scheduler"],oE.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,i=n.length?1===n.length?n[0]:n:null;i?e.open(i,!0):e.close()}),this._eventBus.on("elements.changed",function(t){var n=t.elements,i=e._current;if(i){var r=i.target,o=v(r)?r:[r];if(o.filter(function(e){return n.includes(e)}).length){e.close();var a=o.filter(function(t){return e._elementRegistry.get(t.id)});a.length&&e._updateAndOpen(a.length>1?a:a[0])}}}),this._eventBus.on("canvas.viewbox.changed",function(){e._updatePosition()}),this._eventBus.on("element.marker.update",function(t){if(e.isOpen()){var n=t.element,i=e._current;(v(i.target)?i.target:[i.target]).includes(n)&&e._updateVisibility()}}),this._container=this._createContainer()},oE.prototype._createContainer=function(){var e=eu('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},oE.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,function(e){e.providers.push(t)})},oE.prototype.getEntries=function(e){var t=this._getProviders(),n=v(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return R(t,function(t){if(x(t[n])){var r=t[n](e);x(r)?i=r(i):R(r,function(e,t){i[t]=e})}}),i},oE.prototype.trigger=function(e,t,n){var i,r,o=this,a=t.delegateTarget||t.target;if(!a)return t.preventDefault();if(i=K(a,"data-action"),r=t.originalEvent||t,"mouseover"===e){this._timeout=setTimeout(function(){o._mouseout=o.triggerEntry(i,"hover",r,n)},300);return}if("mouseout"===e){clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null);return}return this.triggerEntry(i,e,r,n)},oE.prototype.triggerEntry=function(e,t,n,i){if(this.isShown()){var r=this._current.target,o=this._current.entries[e];if(o){var a=o.action;if(!1!==this._eventBus.fire("contextPad.trigger",{entry:o,event:n})){if(x(a)){if("click"===t)return a(n,r,i)}else if(a[t])return a[t](n,r,i);n.preventDefault()}}}},oE.prototype.open=function(e,t){!t&&this.isOpen(e)||!1!==this._eventBus.fire("contextPad.open.allowed",{target:e})&&(this.close(),this._updateAndOpen(e))},oE.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},oE.prototype._updateAndOpen=function(e){var t,n=this.getEntries(e),i=this._createHtml(e);R(n,function(e,n){var r,o,a,s,c=e.group||"default",l=eu(e.html||'<div class="entry" draggable="true"></div>');K(l,"data-action",n),(s=es("[data-group="+rd(c)+"]",i))||(K(s=eu('<div class="group"></div>'),"data-group",c),i.appendChild(s)),s.appendChild(l),e.className&&(r=l,o=e.className,a=X(r),(o=v(o)?o:o.split(/\s+/g)).forEac
9h(function(e){a.add(e)})),e.title&&K(l,"title",e.title),e.imageUrl&&(K(t=eu("<img>"),"src",e.imageUrl),t.style.width="100%",t.style.height="100%",l.appendChild(t))}),X(i).add("open"),this._current={entries:n,html:i,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})},oE.prototype._createHtml=function(e){var t=this,n=eu('<div class="djs-context-pad"></div>');return er(n,ow,"click",function(e){t.trigger("click",e)}),er(n,ow,"dragstart",function(e){t.trigger("dragstart",e)}),er(n,ow,"mouseover",function(e){t.trigger("mouseover",e)}),er(n,ow,"mouseout",function(e){t.trigger("mouseout",e)}),en.bind(n,"mousedown",function(e){e.stopPropagation()}),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},oE.prototype.getPad=function(e){var t,n;return console.warn(Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888")),{html:this.isOpen()&&(t=this._current.target,n=e,t=v(t)?t:[t],n=v(n)?n:[n],t.length===n.length&&A(t,function(e){return n.includes(e)}))?this._current.html:this._createHtml(e)}},oE.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},oE.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return v(e)===v(n)&&(v(e)?e.length===n.length&&A(e,function(e){return n.includes(e)}):n===e)},oE.prototype.isShown=function(){return this.isOpen()&&X(this._current.html).has("open")},oE.prototype.show=function(){this.isOpen()&&(X(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))},oE.prototype.hide=function(){this.isOpen()&&(X(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},oE.prototype._getPosition=function(e){if(!v(e)&&tA(e)){var t,n=this._canvas.viewbox(),i=(t=e).waypoints[t.waypoints.length-1],r=i.x*n.scale-n.x*n.scale,o=i.y*n.scale-n.y*n.scale;return{left:r+8*this._canvas.zoom(),top:o}}var a=this._canvas.getContainer().getBoundingClientRect(),s=this._getTargetBounds(e);return{left:s.right-a.left+8*this._canvas.zoom(),top:s.top-a.top}},oE.prototype._updatePosition=function(){let e=()=>{if(this.isOpen()){var e=this._current.html,t=this._getPosition(this._current.target);"x"in t&&"y"in t?(e.style.left=t.x+"px",e.style.top=t.y+"px"):["top","right","bottom","left"].forEach(function(n){n in t&&(e.style[n]=t[n]+"px")})}};this._scheduler.schedule(e,"ContextPad#_updatePosition")},oE.prototype._updateVisibility=function(){let e=()=>{if(this.isOpen()){var e=this,t=this._current.target;(v(t)?t:[t]).some(function(t){return e._canvas.hasMarker(t,"djs-element-hidden")})?e.hide():e.show()}};this._scheduler.schedule(e,"ContextPad#_updateVisibility")},oE.prototype._getTargetBounds=function(e){var t=this;return(v(e)?e:[e]).map(function(e){return t._canvas.getGraphics(e)}).reduce(function(e,t){let n=t.getBoundingClientRect();return e.top=Math.min(e.top,n.top),e.right=Math.max(e.right,n.right),e.bottom=Math.max(e.bottom,n.bottom),e.left=Math.min(e.left,n.left),e.x=e.left,e.y=e.top,e.width=e.right-e.left,e.height=e.bottom-e.top,e},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};let oS={__depends__:[rL,{scheduler:["type",ox]},rs],contextPad:["type",oE]};var ok=n(36480);n.dn(oP);var oC=function(e,t,n,i){var r;t[0]=0;for(var o=1;o<t.length;o++){var a=t[o++],s=t[o]?(t[0]|=a?1:2,n[t[o++]]):t[++o];3===a?i[0]=s:4===a?i[1]=Object.assign(i[1]||{},s):5===a?(i[1]=i[1]||{})[t[++o]]=s:6===a?i[1][t[++o]]+=s+"":a?(r=e.apply(s,oC(e,s,n,["",null])),i.push(r),s[0]?t[0]|=2:(t[o-2]=0,t[o]=r)):i.push(s)}return i},oR=new Map;function oP(e){var t=oR.get(this);return t||(t=new Map,oR.set(this,t)),(t=oC(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,i=1,r="",o="",a=[0],s=function(e){1===i&&(e||(r=r.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?a.push(0,e,r):3===i&&(e||r)?(a.push(3,e,r),i=2):2===i&&"..."===r&&e?a.push(4,e,0):2===i&&r&&!e?a.push(5,0,!0,r):i>=5&&((r||!e&&5===i)&&(a.push(i,0,r,n),i=6),e&&(a.push(i,e,0,n),i=6)),r
9=""},c=0;c<e.length;c++){c&&(1===i&&s(),s(c));for(var l=0;l<e[c].length;l++)t=e[c][l],1===i?"<"===t?(s(),a=[a],i=3):r+=t:4===i?"--"===r&&">"===t?(i=1,r=""):r=t+r[0]:o?t===o?o="":r+=t:'"'===t||"'"===t?o=t:">"===t?(s(),i=1):i&&("="===t?(i=5,n=r,r=""):"/"===t&&(i<5||">"===e[c][l+1])?(s(),3===i&&(a=a[0]),i=a,(a=a[0]).push(2,0,i),i=0):" "===t||" "===t||` 10`===t||`\r`===t?(s(),i=2):r+=t),3===i&&"!--"===r&&(i=4,a=a[0])}return s(),a}(e)),t),arguments,[])).length>1?t:t[0]}var oA=oP.bind(ok.h),oM=n(51262);function oT(e){let{navigationStack:t,setNavigationStack:n}=e,i=(0,oM.Kr)(()=>t.length<=1?[]:t.slice(0,-1).map((e,t)=>({label:e.label,onClick:()=>n(e=>e.slice(0,t+1))})),[t,n]),r=t.length>0?()=>n([]):null,o=t.length>0?t[t.length-1].label:null;return oA` 11 <div class="djs-popup-breadcrumbs"> 12 ${r&&oA` 13 <button 14 type="button" 15 class="djs-popup-breadcrumbs-item djs-popup-breadcrumbs-item--back" 16 title="Back" 17 aria-label="Back" 18 onClick=${r} 19 > 20 <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"> 21 <path fill-rule="evenodd" clip-rule="evenodd" d="M8.03033 1.46967C8.32322 1.76256 8.32322 2.23744 8.03033 2.53033L4.56066 6L8.03033 9.46967C8.32322 9.76256 8.32322 10.2374 8.03033 10.5303C7.73744 10.8232 7.26256 10.8232 6.96967 10.5303L2.96967 6.53033C2.67678 6.23744 2.67678 5.76256 2.96967 5.46967L6.96967 1.46967C7.26256 1.17678 7.73744 1.17678 8.03033 1.46967Z" fill="currentColor"/> 22 </svg> 23 </button> 24 `} 25 ${i.map((e,t)=>oA` 26 <button 27 key=${t} 28 type="button" 29 class="djs-popup-breadcrumbs-item" 30 onClick=${e.onClick} 31 title=${e.label} 32 > 33 ${e.label} 34 </button> 35 <span class="djs-popup-breadcrumbs-item--separator" aria-hidden="true"></span> 36 `)} 37 ${o&&oA` 38 <span class="djs-popup-breadcrumbs-item djs-popup-breadcrumbs-item--current" title=${o}> 39 ${o} 40 </span> 41 `} 42 </div> 43 `}let oB=function(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=function e(t){var n,i,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(n=0;n<o;n++)t[n]&&(i=e(t[n]))&&(r&&(r+=" "),r+=i)}else for(i in t)t[i]&&(r&&(r+=" "),r+=i);return r}(e))&&(i&&(i+=" "),i+=t);return i};function oD(e){let{headerEntries:t,onSelect:n,selectedEntry:i,setSelectedEntry:r,title:o}=e,a=(0,oM.Kr)(()=>t.reduce((e,t)=>{let n=t.group||"default",i=e.find(e=>e.id===n);return i?i.entries.push(t):e.push({id:n,entries:[t]}),e},[]),[t]),s=e=>e.action&&!e.disabled;return oA` 44 <div class="djs-popup-header"> 45 <h3 class="djs-popup-title" title=${o}>${o}</h3> 46 ${a.map(e=>oA` 47 <ul key=${e.id} class="djs-popup-header-group" data-header-group=${e.id}> 48 49 ${e.entries.map(e=>{var t,o;return oA` 50 <li key=${e.id}> 51 <${s(e)?"button":"span"} 52 class=${t=e,o=e===i,oB("entry",t.className,t.active?"active":"",t.disabled?"disabled":"",o?"selected":"")} 53 onClick=${t=>((e,t)=>{if(s(t))return n(e,t)})(t,e)} 54 title=${e.title||e.label} 55 data-id=${e.id} 56 aria-disabled=${e.disabled||void 0} 57 onMouseEnter=${()=>s(e)&&r(e)} 58 onMouseLeave=${()=>s(e)&&r(null)} 59 onFocus=${()=>s(e)&&r(e)} 60 onBlur=${()=>s(e)&&r(null)} 61 > 62 ${e.imageUrl&&oA`<img class="djs-popup-entry-icon" src=${e.imageUrl} alt="" />`||e.imageHtml&&oA`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${{__html:e.imageHtml}} />`} 63 ${e.label?oA` 64 <span class="djs-popup-label">${e.label}</span> 65 `:null} 66 </${e.action?"button":"span"}> 67 </li> 68 `})} 69 </ul> 70 `)} 71 </div> 72 `}function oj(e,t){return`${e}-entry-${t.id}`}function oO(e){let{idPrefix:t,entry:n,selected:i,onMouseEnter:r,onMouseLeave:o,onAction:a}=e,s=(e,t)=>{if(!n.disabled)return a(e,n,t)},c=!n.entries;return oA` 73 <li 74 class=${oB("entry",{selected:i,disabled:n.disabled})} 75 data-id=${n.id} 76 id=${oj(t,n)} 77 role="option" 78 aria-selected=${i||void 0} 79 aria-haspopup=${n.entries?"true":void 0} 80 title=${n.title} 81 aria-disabled=${n.disabled||void 0} 82 onClick=${s} 83 onMouseEnter=${r} 84 onMouseLeave=${o} 85 onDragStart=${e=>c&&s(e,"dragstart")} 86 draggable=${c} 87 > 88 <div class="djs-popup-entry-content">
89 <span 90 class=${oB("djs-popup-entry-name",n.className)} 91 > 92 ${n.imageUrl&&oA`<img class="djs-popup-entry-icon" src=${n.imageUrl} alt="" />`||n.imageHtml&&oA`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${{__html:n.imageHtml}} />`} 93 94 ${n.label?oA` 95 <span class="djs-popup-label"> 96 ${n.label} 97 </span> 98 `:null} 99 </span> 100 ${n.description&&oA` 101 <span 102 class="djs-popup-entry-description" 103 > 104 ${n.description} 105 </span> 106 `} 107 </div> 108 ${(n.documentationRef||n.entries)&&oA` 109 <div class="djs-popup-entry-actions"> 110 ${n.documentationRef&&oA` 111 <a 112 class="djs-popup-entry-docs" 113 href=${n.documentationRef} 114 onClick=${e=>e.stopPropagation()} 115 title="Open entry documentation" 116 tabIndex="-1" 117 aria-hidden="true" 118 target="_blank" 119 rel="noopener" 120 > 121 <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"> 122 <path fill-rule="evenodd" clip-rule="evenodd" d="M10.6368 10.6375V5.91761H11.9995V10.6382C11.9995 10.9973 11.8623 11.3141 11.5878 11.5885C11.3134 11.863 10.9966 12.0002 10.6375 12.0002H1.36266C0.982345 12.0002 0.660159 11.8681 0.396102 11.6041C0.132044 11.34 1.52588e-05 11.0178 1.52588e-05 10.6375V1.36267C1.52588e-05 0.98236 0.132044 0.660173 0.396102 0.396116C0.660159 0.132058 0.982345 2.95639e-05 1.36266 2.95639e-05H5.91624V1.36267H1.36266V10.6375H10.6368ZM12 0H7.2794L7.27873 1.36197H9.68701L3.06507 7.98391L4.01541 8.93425L10.6373 2.31231V4.72059H12V0Z" fill="currentColor"/> 123 </svg> 124 </a> 125 `} 126 ${n.entries&&oA` 127 <div class="djs-popup-entry-chevron" aria-hidden="true"> 128 <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"> 129 <path fill-rule="evenodd" clip-rule="evenodd" d="M3.96967 1.46967C4.26256 1.17678 4.73744 1.17678 5.03033 1.46967L9.03033 5.46967C9.32322 5.76256 9.32322 6.23744 9.03033 6.53033L5.03033 10.5303C4.73744 10.8232 4.26256 10.8232 3.96967 10.5303C3.67678 10.2374 3.67678 9.76256 3.96967 9.46967L7.43934 6L3.96967 2.53033C3.67678 2.23744 3.67678 1.76256 3.96967 1.46967Z" fill="currentColor"/> 130 </svg> 131 </div> 132 `} 133 </div> 134 `} 135 </li> 136 `}function oN(e){let{selectedEntry:t,setSelectedEntry:n,groupedEntries:i,keyboardSelection:r,idPrefix:o,id:a,ariaLabel:s,tabIndex:c,ariaActivedescendant:l,...p}=e,u=(0,oM.li)();(0,oM.Nf)(()=>{var e;if(!r||!r.current)return;let t=u.current;if(!t)return;let n=t.querySelector(".selected");n&&("function"==typeof(e=n).scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded():e.scrollIntoView({scrollMode:"if-needed",block:"nearest"}))},[t]);let h=()=>{r.current||n(null)};return oA` 137 <div 138 class="djs-popup-results" 139 ref=${u} 140 id=${a} 141 role="listbox" 142 aria-label=${s} 143 tabIndex=${c} 144 aria-activedescendant=${l} 145 onMouseMove=${()=>{r.current=!1}} 146 > 147 ${i.map(e=>oA` 148 ${e.name&&oA` 149 <div key=${e.id} id=${oL(o,e)} class="entry-header" title=${e.name}> 150 ${e.name} 151 </div> 152 `} 153 <ul 154 class="djs-popup-group" 155 data-group=${e.id} 156 role="group" 157 aria-labelledby=${e.name?oL(o,e):void 0} 158 > 159 ${e.entries.map(e=>oA` 160 <${oO} 161 key=${e.id} 162 idPrefix=${o} 163 entry=${e} 164 selected=${e===t} 165 onMouseEnter=${()=>{!r.current&&n(e)}} 166 onMouseLeave=${h} 167 ...${p} 168 /> 169 `)} 170 </ul> 171 `)} 172 </div> 173 `}function oL(e,t){return`${e}-group-${t.id}`}let o$=new rt("djs-popup");function oI(e){let{onClose:t,onSelect:n,className:i,headerEntries:r,position:o,title:a,width:s,scale:c,search:l,emptyPlaceholder:p,searchFn:u,entries:h,onOpened:d,onClosed:f,defaultTab:m}=e,[y,v]=(0,oM.J0)([]);(0,oM.vJ)(()=>{v([]),w(null)},[h]);let b=(0,oM.Kr)(()=>{let e=[],t=new Set,n=!1;
173return(h.forEach(({tab:i})=>{if(!i){n=!0;return}t.has(i.id)||(t.add(i.id),e.push(i))}),e.length&&(!n||m))?n?[m,...e.filter(e=>e.id!==m.id)]:e:[]},[h,m]),[_,w]=(0,oM.J0)(null),E=b.some(e=>e.id===_)?_:b.length?b[0].id:null,S=(0,oM.li)();(0,oM.Nf)(()=>{let e=S.current;if(!e)return;let t=e.querySelector('[aria-selected="true"]');t&&oF(t)},[E]);let[k,C]=(0,oM.J0)({start:!1,end:!1}),R=(0,oM.hb)(()=>{let{scrollLeft:e,scrollWidth:t,clientWidth:n}=S.current;C({start:e>0,end:t-n-e>1})},[]),P=(0,oM.hb)(e=>{let t=S.current,n=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;if(!n)return;let{scrollLeft:i,scrollWidth:r,clientWidth:o}=t;r-o<1||(e.preventDefault(),t.scrollLeft=i+n,R())},[R]);(0,oM.Nf)(()=>{let e=S.current;if(e)return R(),e.addEventListener("scroll",R),e.addEventListener("wheel",P,{passive:!1}),()=>{e.removeEventListener("scroll",R),e.removeEventListener("wheel",P)}},[b,E,R,P]);let A=(0,oM.hb)(e=>{let t=S.current,n=e>0?[...t.children]:[...t.children].reverse(),i=t.getBoundingClientRect(),r=n.find(t=>{let n=t.getBoundingClientRect();return e>0?n.right>i.right+1:n.left<i.left-1});r&&(oF(r),R())},[R]),M=(0,oM.hb)(e=>e.tab&&e.tab.id||m&&m.id,[m]),[T,B]=(0,oM.J0)(""),D=T.trim().length>0,j=(0,oM.Kr)(()=>{let e;return e=[],!function t(n){n.forEach(n=>{n.entries?t(n.entries):e.push(n)})}(h),e},[h]),O=(0,oM.Kr)(()=>!!g(l)&&j.length>5,[l,j]),N=(0,oM.Kr)(()=>{let e=y.length?y[y.length-1].entries:b.length>1?h.filter(e=>M(e)===E):h;return O?D?u(j.filter(({searchable:e})=>!1!==e),T,{keys:["label","search","description"]}).map(({item:e})=>e):e.filter(({rank:e=0})=>e>=0):e},[O,D,j,T,u,y,h,b,E,M]),L=(0,oM.Kr)(()=>{var e;let t,n;return D?N.length?[{id:"default",entries:N}]:[]:(e=N,t=[],n=e=>t.find(t=>e.id===t.id),e.forEach(e=>{let i,r=e.group?"string"==typeof(i=e.group)?{id:i}:i:{id:"default"};n(r)?n(r).entries.push(e):t.push({...r,entries:[e]})}),t)},[N,D]),[$,I]=(0,oM.J0)(N[0]),F=(0,oM.li)(null),z=(0,oM.li)(!1),H=(0,oM.Kr)(()=>o$.next(),[]),V=`${H}-results`,G=$&&oj(H,$);(0,oM.vJ)(()=>{let e=F.current;e&&N.includes(e)?I(e):I(N[0]),F.current=null},[N]);let W=(0,oM.hb)(e=>{let t,n=(t=[],L.forEach(e=>{e.entries.forEach(e=>{t.push(e)})}),t),i=n.indexOf($)+e;i<0&&(i=n.length-1),i>=n.length&&(i=0),z.current=!0,I(n[i])},[L,$]),U=(0,oM.hb)(e=>{e>0&&$&&$.entries&&(z.current=!0,v(e=>[...e,$])),e<0&&y.length>0&&(z.current=!0,F.current=y[y.length+e],v(t=>t.slice(0,e)))},[$,y]),q=(0,oM.hb)((e,t,i)=>{if(t&&!t.disabled)return t.entries?(e.preventDefault(),U(1)):n(e,t,i)},[n,U]),K=(0,oM.hb)(e=>{if("Enter"===e.key&&$){if(Q(e.target,"a, button",!0)||$.disabled)return;return q(e,$)}if("Backspace"===e.key){let t=e.target;if(!(ea(t,"input")&&""!==t.value))return U(-1),e.preventDefault()}return"ArrowUp"===e.key?(W(-1),e.preventDefault()):"ArrowDown"===e.key?(W(1),e.preventDefault()):"ArrowRight"===e.key?(U(1),e.preventDefault()):"ArrowLeft"===e.key?(U(-1),e.preventDefault()):void 0},[$,W,U,q]),Y=(0,oM.hb)((e,t)=>{if(w(t),!e.detail)return;let n=Q(e.currentTarget,".djs-popup",!0),i=n&&n.querySelector("input");i&&i.focus()},[]),X=(0,oM.hb)(e=>{let t;if("Enter"===e.key||" "===e.key)return void e.stopPropagation();if("ArrowDown"===e.key||"ArrowUp"===e.key){let t=Q(e.currentTarget,".djs-popup",!0),n=t.querySelector("input")||t.querySelector('[role="listbox"]');n&&n.focus();return}let n=b.findIndex(e=>e.id===E);if("ArrowLeft"===e.key)t=(n-1+b.length)%b.length;else if("ArrowRight"===e.key)t=(n+1)%b.length;else if("Home"===e.key)t=0;else{if("End"!==e.key)return;t=b.length-1}e.preventDefault(),e.stopPropagation(),w(b[t].id);let i=e.currentTarget.parentNode,r=i&&i.children[t];r&&r.focus()},[b,E]),Z=(0,oM.hb)(e=>{ea(e.target,"input")&&B(()=>e.target.value)},[B]);(0,oM.vJ)(()=>(d(),()=>{f()}),[]);let J=!D&&y.length>0,ee=b.length>1&&!D&&0===y.length,et=(a||r.length>0)&&!J;return oA` 174 <${oz} 175 onClose=${t} 176 onKeyup=${Z} 177 onKeydown=${K} 178 className=${i} 179 position=${o} 180 width=${s} 181 scale=${c} 182 navigationStack=${y} 183 > 184 ${et&&oA` 185 <${oD} 186 headerEntries=${r} 187 onSelect=${n} 188 selectedEntry=${$} 189 setSelectedEntry=${I} 190 title=${a} 191 /> 192 `} 193 ${J&&oA` 194 <${oT} 195 navigationStack=${y} 196 setNavigationStack=${v} 197 /> 198 `} 199 ${h.length>0&&oA` 200 <div class="djs-popup-body"> 201 202 ${O&&oA` 203 <div class="djs-popup-search"> 204 <svg class="djs-popup-search-icon" width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"> 205 <path fill-rule="evenodd" clip-rule="evenodd" d="M9.0325 8.5H9.625L13.3675 12.25L12.25 13.3675L8.5 9.625V9.0325L8.2975 8.8225C7.4425 9.5575 6.3325 10 5.125 10C2.4325 10 0.25 7.8175 0.25 5.125C0.25 2.4325 2.4325 0.25 5.125 0.25C7.8175 0.25 10 2.4325 10 5.125C10 6.3325 9.5575 7.4425 8.8225 8.2975L9.0325 8.5ZM1.75 5.125C1.75 6.9925 3.2575 8.5 5.125 8.5C6.9925 8.5 8.5 6.9925 8.5 5.125C8.5 3.2575 6.9925 1.75 5.125 1.75C3.2575 1.75 1.75 3.2575 1.75 5.125Z" fill="#22242A"/> 206 </svg> 207 <input 208 type="text" 209 spellcheck=${!1} 210 role="combobox" 211 aria-label="${a||"Search"}" 212 aria-expanded="true" 213 aria-controls=${V} 214 aria-activedescendant=${G||void 0} 215 aria-autocomplete="list" 216 /> 217 </div> 218 `} 219 220 ${ee&&oA` 221 <div class="djs-popup-tabs-container"> 222 <div class="djs-popup-tabs" ref=${S} role="tablist"> 223 ${b.map(e=>oA` 224 <button 225 type="button" 226 class="djs-popup-tab" 227 role="tab" 228 title=${e.title||void 0} 229 aria-controls=${V} 230 aria-selected=${e.id===E} 231 tabIndex=${e.id===E?0:-1} 232 onClick=${t=>Y(t,e.id)} 233 onKeydown=${X} 234 >${e.label}</button> 235 `)} 236 </div> 237 238 ${""} 239 ${[-1,1].map(e=>(e<0?k.start:k.end)&&oA` 240 <button 241 type="button" 242 class=${`djs-popup-tabs-scroll djs-popup-tabs-scroll-${e<0?"start":"end"}`} 243 aria-hidden="true" 244 tabIndex="-1" 245 onMousedown=${e=>e.preventDefault()} 246 onClick=${()=>A(e)} 247 > 248 <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"> 249 <path fill-rule="evenodd" clip-rule="evenodd" d="M3.96967 1.46967C4.26256 1.17678 4.73744 1.17678 5.03033 1.46967L9.03033 5.46967C9.32322 5.76256 9.32322 6.23744 9.03033 6.53033L5.03033 10.5303C4.73744 10.8232 4.26256 10.8232 3.96967 10.5303C3.67678 10.2374 3.67678 9.76256 3.96967 9.46967L7.43934 6L3.96967 2.53033C3.67678 2.23744 3.67678 1.76256 3.96967 1.46967Z" fill="currentColor"/> 250 </svg> 251 </button> 252 `)} 253 </div> 254 `} 255 256 ${D&&oA` 257 <div class="djs-popup-search-count" aria-live="polite"> 258 ${N.length} ${1===N.length?"result":"results"} found 259 </div> 260 `} 261 262 <${oN} 263 groupedEntries=${L} 264 selectedEntry=${$} 265 setSelectedEntry=${I} 266 keyboardSelection=${z} 267 onAction=${q} 268 idPrefix=${H} 269 id=${V} 270 ariaLabel=${a||"Results"} 271 tabIndex=${O?-1:0} 272 ariaActivedescendant=${O?void 0:G||void 0} 273 /> 274 275 ${$&&$.documentationRef&&oA` 276 <div class="djs-popup-footer"> 277 <a 278 class="djs-popup-footer-docs" 279 href=${$.documentationRef} 280 onClick=${e=>e.stopPropagation()} 281 aria-label=${$.label?`Open entry documentation for ${$.label}`:"Open entry documentation"} 282 target="_blank" 283 rel="noopener" 284 > 285 Open entry documentation 286 287 <svg aria-hidden="true" width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"> 288 <path fill-rule="evenodd" clip-rule="evenodd" d="M10.6368 10.6375V5.91761H11.9995V10.6382C11.9995 10.9973 11.8623 11.3141 11.5878 11.5885C11.3134 11.863 10.9966 12.0002 10.6375 12.0002H1.36266C0.982345 12.0002 0.660159 11.8681 0.396102 11.604
2881C0.132044 11.34 1.52588e-05 11.0178 1.52588e-05 10.6375V1.36267C1.52588e-05 0.98236 0.132044 0.660173 0.396102 0.396116C0.660159 0.132058 0.982345 2.95639e-05 1.36266 2.95639e-05H5.91624V1.36267H1.36266V10.6375H10.6368ZM12 0H7.2794L7.27873 1.36197H9.68701L3.06507 7.98391L4.01541 8.93425L10.6373 2.31231V4.72059H12V0Z" fill="#818798"/> 289 </svg> 290 </a> 291 </div> 292 `} 293 </div> 294 `} 295 ${p&&0===N.length&&oA` 296 <div class="djs-popup-no-results">${x(p)?p(T):p}</div> 297 `} 298 </${oz}> 299 `}function oF(e){"function"==typeof e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded():e.scrollIntoView({scrollMode:"if-needed",block:"nearest",inline:"nearest"})}function oz(e){let{onClose:t,onKeydown:n,onKeyup:i,className:r,children:o,navigationStack:a,position:s}=e,c=(0,oM.li)();return(0,oM.Nf)(()=>{if("function"!=typeof s)return;let e=c.current,t=s(e);e.style.left=`${t.x}px`,e.style.top=`${t.y}px`},[c.current,s]),(0,oM.Nf)(()=>{let e=c.current;e&&(e.querySelector("input")||e.querySelector('[role="listbox"]')||e).focus()},[a]),(0,oM.vJ)(()=>{let e=e=>{if("Escape"===e.key)return e.preventDefault(),t()},n=e=>{if(!Q(e.target,".djs-popup",!0))return t()};return document.documentElement.addEventListener("keydown",e),document.body.addEventListener("click",n,!0),()=>{document.documentElement.removeEventListener("keydown",e),document.body.removeEventListener("click",n,!0)}},[]),oA` 300 <div 301 class=${oB("djs-popup",r)} 302 style=${function(e){let{width:t}=e,n="number"==typeof t?`${t}px`:t;return{transform:`scale(${e.scale})`,width:g(t)?n:void 0,maxWidth:g(t)?"unset":void 0,"transform-origin":"top left"}}(e)} 303 onKeydown=${n} 304 onKeyup=${i} 305 ref=${c} 306 tabIndex="-1" 307 > 308 ${o} 309 </div> 310 `}var oH=["contextPad.close","canvas.viewbox.changing","commandStack.changed"];function oV(e,t,n,i){this._eventBus=t,this._canvas=n,this._search=i,this._current=null;var r=g(e&&e.scale)?e.scale:{min:1,max:1};this._config={scale:r,defaultTab:e&&e.defaultTab},t.on("diagram.destroy",()=>{this.close()}),t.on("element.changed",e=>{let t=this.isOpen()&&this._current.target;e.element===t&&this.refresh()})}function oG(e){return e?v(e)?e:[e]:[]}oV.$inject=["config.popupMenu","eventBus","canvas","search"],oV.prototype._render=function(){let{position:e,providerId:t,entries:n,headerEntries:i,emptyPlaceholder:r,options:o}=this._current,a=function e(t,n=[]){return Object.entries(t).map(([t,i])=>{let r={id:t,...i};return r.entries?r.entries=e(r.entries,[...n,...oG(r.search)]):n.length&&(r.search=[...n,...oG(r.search)]),r})}(n),s=Object.entries(i).map(([e,t])=>({id:e,...t})),c=e&&(t=>this._ensureVisible(t,e)),l=this._updateScale(this._current.container),p=e=>this.close(e),u=(e,t,n)=>this.trigger(e,t,n);(0,ok.XX)(oA` 311 <${oI} 312 onClose=${p} 313 onSelect=${u} 314 position=${c} 315 className=${t} 316 entries=${a} 317 headerEntries=${s} 318 emptyPlaceholder=${r} 319 scale=${l} 320 onOpened=${this._onOpened.bind(this)} 321 onClosed=${this._onClosed.bind(this)} 322 searchFn=${this._search} 323 defaultTab=${this._config.defaultTab} 324 ...${{...o}} 325 /> 326 `,this._current.container)},oV.prototype.open=function(e,t,n,i){if(!e)throw Error("target is missing");if(!t)throw Error("providers for <"+t+"> not found");if(!n)throw Error("position is missing");if(!1===this._eventBus.fire("popupMenu.open.allowed",{target:e,providerId:t}))return;this.isOpen()&&this.close();let{entries:r,headerEntries:o,emptyPlaceholder:a}=this._getContext(e,t);this._current={position:n,providerId:t,target:e,entries:r,headerEntries:o,emptyPlaceholder:a,container:this._createContainer({provider:t}),options:i},this._emit("open"),this._bindAutoClose(),this._render()},oV.prototype.refresh=function(){if(!this.isOpen())return;let{target:e,providerId:t}=this._current,{entries:n,headerEntries:i,emptyPlaceholder:r}=this._getContext(e,t);this._current={...this._current,entries:n,headerEntries:i,emptyPlaceholder:r},this._emit("refresh"),this._render()},oV.prototype._getContext=function(e,t){let n=this._getProviders(t);if(!n||!n.length)throw Error("provider for <"+t+"> not found");let i=this._getEntries(e,n),r=this._getHeaderEntries(e,n);return{entries:i,headerEntries:r,emptyPlaceholder:this._getEmptyPlaceholder(n),empty:!(Object.keys(i).length||Object.keys(r).length)}},oV.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._canvas.restoreFocus(),this._current=null)},oV.prototype.reset=function(){let e=this._current.container;(0,ok.XX)(null,e),el(e)},oV.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)},oV.prototype._onOpened=function(){this._emit("opened")},oV.prototype._onClosed=function(){this._emit("closed")},oV.prototype._createContainer=function(e){var t=this._canvas.getContainer();let n=eu(`<div class="djs-popup-parent djs-scrollable" data-popup=${e.provider}></div>`);return t.appendChild(n),n},oV.prototype._bindAutoClose=function(){this._eventBus.once(oH,this.close,this)},oV.prototype._unbindAutoClose=function(){this._eventBus.off(oH,this.close,this)},oV.prototype._updateScale=function(){var e,t,n=this._canvas.zoom(),i=this._config.scale,r=n;return!0!==i&&(!1===i?(e=1,t=1):(e=i.min,t=i.max),g(e)&&n<e&&(r=e),g(t)&&n>t&&(r=t)),r},oV.prototype._ensureVisible=function(e,t){var n=document.documentElement.getBoundingClientRect(),i=e.getBoundingClientRect(),r={},o=t.x,a=t.y;return t.x+i.width>n.width&&(r.x=!0),t.y+i.height>n.height&&(r.y=!0),r.x&&r.y?(o=t.x-i.width,a=t.y-i.height):r.x?(o=t.x-i.width,a=t.y):r.y&&t.y<i.height?(o=t.x,a=10):r.y&&(o=t.x,a=t.y-i.height),t.y<n.top&&(a=t.y+i.height),{x:o,y:a}},oV.prototype.isEmpty=function(e,t){if(!e)throw Error("target is missing");if(!t)throw Error("provider ID is missing");let n=this._getProviders(t);return!n||!n.length||this._getContext(e,t).empty},oV.prototype.registerProvider=function(e,t,n){n||(n=t,t=1e3),this._eventBus.on("popupMenu.getProviders."+e,t,function(e){e.providers.push(n)})},oV.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},oV.prototype._getEntries=function(e,t){var n={};return R(t,function(t){if(!t.getPopupMenuEntries)return void R(t.getEntries(e),function(e){var t=e.id;if(!t)throw Error("entry ID is missing");n[t]=U(e,["id"])});var i=t.getPopupMenuEntries(e);x(i)?n=i(n):R(i,function(e,t){n[t]=e})}),n},oV.prototype._getHeaderEntries=function(e,t){var n={};return R(t,function(t){if(!t.getPopupMenuHeaderEntries){if(!t.getHeaderEntries)return;R(t.getHeaderEntries(e),function(e){var t=e.id;if(!t)throw Error("entry ID is missing");n[t]=U(e,["id"])});return}var i=t.getPopupMenuHeaderEntries(e);x(i)?n=i(n):R(i,function(e,t){n[t]=e})}),n},oV.prototype._getEmptyPlaceholder=function(e){let t=e.find(e=>x(e.getEmptyPlaceholder));return t&&t.getEmptyPlaceholder()},oV.prototype.isOpen=function(){return!!this._current},oV.prototype.trigger=function(e,t,n="click"){if(e.preventDefault(),!t){let n=K(Q(e.delegateTarget||e.target,".entry",!0),"data-id");t={id:n,...this._getEntry(n)}}let i=t.action;if(!1!==this._emit("trigger",{entry:t,event:e}
326)){if(x(i)){if("click"===n)return i(e,t)}else if(i[n])return i[n](e,t)}},oV.prototype._getEntry=function(e){var t=this._current.entries[e]||this._current.headerEntries[e];if(!t)throw Error("entry not found");return t};function oW(e){let t=e.reduce((e,t)=>e+function e(t){if(v(t))return Math.max(...t.map(e));let n=Math.log(t.value.length);return t.match?(t.start?t.end?131.9:t.wordEnd?8:7.87:t.wordStart?2.19:1)*n:-.07*n}(t),0),n=e.flat(),i=n.reduce((e,t)=>e+t.value.length,0),r=n.reduce((e,t)=>e+(t.match?t.value.length:0),0);return t*(1+(i?r/i:0))}function oU(e=""){return v(e)?e.join(", "):e}function oq(e,t){let n;if(!e)return{tokens:[],matchedWords:{}};let i=[],r={},o=t.map(oK),a=RegExp([`(?<all>${o.join("\\s+")})`,...o].join("|"),"ig"),s=0;for(;n=a.exec(e);){var c;let[o]=n,a=n.index,l=n.index+o.length,p=0===a,u=l===e.length,h=!!(null!=(c=n.groups)&&c.all),d=p||/\s/.test(e.charAt(a-1)),f=u||/\s/.test(e.charAt(l));for(let a of(n.index>s&&i.push({value:e.slice(s,n.index),index:s}),i.push({value:o,index:n.index,match:!0,wordStart:d,wordEnd:f,start:p,end:u,all:h}),h?t:[o]))r[a.toLowerCase()]=!0;s=n.index+o.length}return s<e.length&&i.push({value:e.slice(s),index:s}),{tokens:i,matchedWords:r}}function oK(e){return e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")}let oY={search:["value",function(e,t,n){var i;let{keys:r}=n;if(!(t=t.trim().toLowerCase()))throw Error("<pattern> must not be empty");let o=t.trim().toLowerCase().split(/\s+/);return e.flatMap(e=>{let t=function(e,t,n){let{matchedWords:i,tokens:r}=n.reduce((n,i)=>{let r=e[i],{tokens:o,matchedWords:a}=v(r)?r.reduce((e,n)=>{let{tokens:i,matchedWords:r}=oq(n,t);return{tokens:[...e.tokens,i],matchedWords:{...e.matchedWords,...r}}},{matchedWords:{},tokens:[]}):oq(r,t);return{tokens:{...n.tokens,[i]:o},matchedWords:{...n.matchedWords,...a}}},{matchedWords:{},tokens:{}});return Object.keys(i).length!==t.length?null:r}(e,o,r);return t?{item:e,tokens:t}:[]}).sort((i=r,(e,t)=>{let n=0,r=1;for(let c of i){var o,a,s;let i=(o=e.tokens[c],oW(t.tokens[c])-oW(o));if(0!==i){n+=i*r,r*=.5;continue}let l=(a=e.item[c],s=t.item[c],oU(a).localeCompare(oU(s)));if(0!==l){n+=l*r,r*=.5;continue}}return n}))}]},oX={__depends__:[oY],__init__:["popupMenu"],popupMenu:["type",oV]};var oZ={align:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
327 <line x1="200" y1="150" x2="200" y2="1850" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/> 328 <rect x="500" y="150" width="1300" height="700" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect> 329 <rect x="500" y="1150" width="700" height="700" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect> 330 </svg>`,bottom:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800"> 331 <line x1="150" y1="1650" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/> 332 <rect x="150" y="350" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect> 333 <rect x="1050" y="850" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect> 334 </svg>`,center:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800"> 335 <line x1="900" y1="150" x2="900" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/> 336 <rect x="250" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect> 337 <rect x="500" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect> 338 </svg>`,left:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800"> 339 <line x1="100" y1="150" x2="100" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/> 340 <rect x="100" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect> 341 <rect x="100" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect> 342 </svg>`,right:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800"> 343 <line x1="1650" y1="150" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/> 344 <rect x="350" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect> 345 <rect x="850" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect> 346 </svg>`,top:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800"> 347 <line x1="150" y1="150" x2="1650" y2="150" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/> 348 <rect x="150" y="150" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect> 349 <rect x="1050" y="150" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect> 350 </svg>`,middle:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800"> 351 <line x1="150" y1="900" x2="1650" y2="900" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/> 352 <rect x="150" y="250" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect> 353 <rect x="1050" y="500" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect> 354 </svg>`};function oJ(e,t,n,i){e.registerProvider(900,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=i}oJ.$inject=["contextPad","popupMenu","translate","canvas"],oJ.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&G(t,this._getEntries(e)),t},oJ.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")},oJ.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`<div class="entry">${oZ.align}</div>`,action:{click:function(t,n){var i=e._getMenuPosition(n);G(i,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",i)}}}}},oJ.prototype._getMenuPosition=function(e){var t=this._contextPad.getPad(e).html.getBoundingClientRect();return{x:t.left,y:t.bottom+5}};var oQ=["left","center","right","top","middle","bottom"];function o0(e,t,n,i){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",this)}function o1(e){rp.call(this,e),this.init()}function o2(e){o1.call(this,e)}function o5(e,t,n,i){for(var r;r=function(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height};return S(function(e){var t=o6(e);return e.host&&(t=t.concat(o6(e.host))),e.attachers&&(t=t.concat(e.attachers.reduce(function(e,t){return e.concat(o6(t))},[]))),t}(e),function(e){return e!==n&&"intersect"===tN(e,i,10)})}(e,n,t);)n=i(t,n,r);return n}function o3(e){return function(t,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach(function(o){var a=e[o];if(a){var s="x"===o?"width":"height",c=a.margin,l=a.minDistance;c<0?r[o]=Math.min(i[o]+c-t[s]/2,n[o]-l+c):r[o]=Math.max(i[o]+i[s]+c+t[s]/2,n[o]+l+c)}}),r}}function o6(e){return e.outgoing.map(function(e){return e.target}).concat(e.incoming.map(function(e){return e.source}))}function o9(){return!0}function o4(e,t,n){e.on("autoPlace",100,function(e){var t,n,i,r,o,a=e.shape;return t=e.source,n=a,i||(i={}),r=i.defaultDistance||50,o=tO(t),{x:tD(t).right+r+n.width/2,y:o.y}}),e.on("autoPlace.end",function(e){n.scrollToElement(e.shape)}),this.append=function(n,i,r){e.fire("autoPlace.start",{source:n,shape:i});var o=e.fire("autoPlace",{source:n,shape:i}
354),a=t.appendShape(n,i,o,n.parent,r);return e.fire("autoPlace.end",{source:n,shape:a}),a}}function o8(e,t){e.on("autoPlace.end",500,function(e){t.select(e.shape)})}function o7(e,t){for(w(t)&&(t=[t]);e=e.parent;)if(ih(e,t))return e;return null}function ae(e,t){var n,i=o7(e,"bpmn:Process");if(i)return!0;var r=["bpmn:Participant","bpmn:Lane"];if(i=o7(e,r))return iM(i);if(ih(e,r))return iM(e);for(n=id(e);n&&!iu(n,"bpmn:Process");n=n.$parent);if(!t)return!0;var o=t.find(function(e){var t=id(e);return t&&t.get("processRef")===n});return!o||iM(o)}function at(e,t,n){var i,r,o,a,s,c,l,p,u,h,d,f,m,g,y,v,b,_,x,w,E,S,k,C,R=ae(e,n);return iu(t,"bpmn:TextAnnotation")?(i=e,r=t,o=R,a=tD(i),s=o?{x:a.right+r.width/2,y:a.top-50-r.height/2}:{x:a.right+50+r.width/2,y:a.bottom+r.height/2},tA(i)&&(s=tO(i),o?(s.x+=100,s.y-=50):(s.x+=100,s.y+=50)),c={margin:o?-30:30,minDistance:20},o5(i,r,s,o3(o?{y:c}:{x:c}))):ih(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?(l=e,p=t,u=R,h=tD(l),d=u?{x:h.right-10+p.width/2,y:h.bottom+40+p.width/2}:{x:h.left-40-p.width/2,y:h.bottom-10+p.height/2},f={margin:30,minDistance:30},o5(l,p,d,o3(u?{x:f}:{y:f}))):iu(t,"bpmn:FlowNode")?(m=e,g=t,y=R,v=tD(m),b=tO(m),x=function(e,t){t||(t={});var n=t.defaultDistance||50,i=t.direction||"e",r=t.filter,o=t.getWeight||function(t){return t.source===e?1:-1},a=t.maxDistance||250,s=t.reference||"start";function c(e,t){if("n"===i)if("start"===s)return tD(e).top-tD(t).bottom;else if("center"===s)return tD(e).top-tO(t).y;else return tD(e).top-tD(t).top;if("w"===i)if("start"===s)return tD(e).left-tD(t).right;else if("center"===s)return tD(e).left-tO(t).x;else return tD(e).left-tD(t).left;if("s"===i)if("start"===s)return tD(t).top-tD(e).bottom;else if("center"===s)return tO(t).y-tD(e).bottom;else return tD(t).bottom-tD(e).bottom;if("start"===s)return tD(t).left-tD(e).right;if("center"===s)return tO(t).x-tD(e).right;else return tD(t).right-tD(e).right}r||(r=o9);var l=e.incoming.filter(r).map(function(t){var n=o(t),i=n<0?c(t.source,e):c(e,t.source);return{id:t.source.id,distance:i,weight:n}}),p=e.outgoing.filter(r).map(function(t){var n=o(t),i=n>0?c(e,t.target):c(t.target,e);return{id:t.target.id,distance:i,weight:n}});return P(l.concat(p).reduce(function(e,t){return e[t.id+"__weight_"+t.weight]=t,e},{}),function(e,t){var n=t.distance,i=t.weight;return n<0||n>a||(e[String(n)]||(e[String(n)]=0),e[String(n)]+=+i,(!e.distance||e[e.distance]<e[String(n)])&&(e.distance=n)),e},{}).distance||n}(m,{filter:function(e){return iu(e,"bpmn:SequenceFlow")},direction:(_=y?{directionHint:"e",minDistance:80,baseOrientation:"left",boundaryOrientation:"top",start:"top",end:"bottom"}:{directionHint:"s",minDistance:90,baseOrientation:"top",boundaryOrientation:"left",start:"left",end:"right"}).directionHint}),w=30,E=_.minDistance,S=_.baseOrientation,iu(m,"bpmn:BoundaryEvent")&&-1!==(S=tN(m,m.host,-25)).indexOf(_.boundaryOrientation)&&(w*=-1),k=y?{x:v.right+x+g.width/2,y:b.y+an(S,E,_)}:{x:b.x+an(S,E,_),y:v.bottom+x+g.height/2},C={margin:w,minDistance:E},o5(m,g,k,o3(y?{y:C}:{x:C}))):void 0}function an(e,t,n){return e.includes(n.start)?-1*t:e.includes(n.end)?t:0}function ai(e,t){e.on("autoPlace",function(e){var n=e.shape;return at(e.source,n,t)})}o0.$inject=["popupMenu","alignElements","translate","rules"],o0.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&G(t,this._getEntries(e)),t},o0.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})},o0.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,i=this._popupMenu,r={};return R(oQ,function(o){r["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:oZ[o],action:function(){t.trigger(e,o),i.close()}}}),r},o1.$inject=["eventBus"],i(o1,rp),o1.prototype.addRule=function(e,t,n){var i=this;"string"==typeof e&&(e=[e]),e.forEach(function(e){i.canExecute(e,t,function(e,t,i){return n(e)},!0)})},o1.prototype.init=function(){},o2.$inject=["eventBus"],i(o2,o1),o2.prototype.init=function(){this.addRule("elements.align",function(e){var t=C(e.elements,function(e){return!(e.waypoints||e.host||e.labelTarget)});return!((t=eJ(t)).length<2)&&t})},o4.$inject=["eventBus","modeling","canvas"],o8.$inject=["eventBus","selection"],ai.$inject=["eventBus","elementRegistry"];let ar={__depends__:[{__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",o4],autoPlaceSelectionBehavior:["type",o8]}],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",ai]};function ao(e,t,n,i){rp.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=i;var r=this;this.postExecuted(["shape.create"],function(e){var t=e.context,n=t.hints||{},i=t.shape,o=t.parent||t.newParent;!1!==n.autoResize&&r._expand([i],o)}),this.postExecuted(["elements.move"],function(e){var t=e.context,n=h(D(t.closure.topLevel)),i=t.hints,o=!i||i.autoResize;!1!==o&&R(j(n,function(e){return e.parent.id}),function(e,t){v(o)&&(e=e.filter(function(e){return S(o,L({id:e.id}))})),r._expand(e,t)})}),this.postExecuted(["shape.toggleCollapse"],function(e){var t=e.context,n=t.hints,i=t.shape;n&&!1===n.autoResize||i.collapsed||r._expand(i.children||[],i)}),this.postExecuted(["shape.resize"],function(e){var t=e.context,n=t.hints,i=t.shape,o=i.parent;(!n||!1!==n.autoResize)&&o&&r._expand([i],o)})}function aa(e){e.invoke(ao,this)}function as(e){o1.call(this,e);var t=this;this.addRule("element.autoResize",function(e){return t.canResize(e.elements,e.target)})}function ac(e,t){as.call(this,e),this._modeling=t}function al(e,t,n){var i,r,o=this,a=n.get("dragging",!1);a&&t.on("drag.start",function(n){t.once("drag.move",1500,function(t){if(!t.hover){var n=t.originalEvent,i=o._findTargetGfx(n),r=i&&e.get(i);i&&r&&(t.stopPropagation(),a.hover({element:r,gfx:i}),a.move(n))}})}),t.on("element.hover",function(e){i=e.gfx,r=e.element}),t.on("element.hover",1500,function(e){r&&t.fire("element.out",{element:r,gfx:i})}),t.on("element.out",function(){i=null,r=null}),this._findTargetGfx=function(e){var t;if(e instanceof MouseEvent)return t=rP(e),Q(document.elementFromPoint(t.x,t.y),"svg, .djs-element",!0)}}ao.$inject=["eventBus","elementRegistry","modeling","rules"],i(ao,rp),ao.prototype._getOptimalBounds=function(e,t){var n=this.getOffset(t),i=this.getPadding(t),r=tD(e2(e)),o=tD(t),a={};return r.top-o.top<i.top&&(a.top=r.top-n.top),r.left-o.left<i.left&&(a.left=r.left-n.left),o.right-r.right<i.right&&(a.right=r.right+n.right),o.bottom-r.bottom<i.bottom&&(a.bottom=r.bottom+n.bottom),tj(G({},o,a))},ao.prototype._expand=function(e,t){if("string"==typeof t&&(t=this._elementRegistry.get(t)),this._rules.allowed("element.autoResize",{elements:e,target:t})){var n=this._getOptimalBounds(e,t);if(i=n,r=t,i.x!==r.x||i.y!==r.y||i.width!==r.width||i.height!==r.height){var i,r,o,a,s,c=(o=W(t,["x","y","width","height"]),a=n,s="",o=tD(o),a=tD(a),o.top>
354a.top&&(s=s.concat("n")),o.right<a.right&&(s=s.concat("w")),o.bottom<a.bottom&&(s=s.concat("s")),o.left>a.left&&(s=s.concat("e")),s);this.resize(t,n,{autoResize:c});var l=t.parent;l&&this._expand([t],l)}}},ao.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},ao.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},ao.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)},aa.$inject=["injector"],i(aa,ao),aa.prototype.resize=function(e,t,n){iu(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)},as.$inject=["eventBus"],i(as,o1),as.prototype.canResize=function(e,t){return!1},i(ac,as),ac.$inject=["eventBus","modeling"],ac.prototype.canResize=function(e,t){if(iu(t.di,"bpmndi:BPMNPlane")||!iu(t,"bpmn:Participant")&&!iu(t,"bpmn:Lane")&&!iu(t,"bpmn:SubProcess"))return!1;var n=!0;return R(e,function(e){if(iu(e,"bpmn:Lane")||tM(e)){n=!1;return}}),n},al.$inject=["elementRegistry","eventBus","injector"];var ap=Math.round,au="djs-drag-active";function ah(e){e.preventDefault()}function ad(e,t,n,i){var r,o={threshold:5,trapClick:!0};function a(e){var n=t.viewbox(),i=t._container.getBoundingClientRect();return{x:n.x+(e.x-i.left)/n.scale,y:n.y+(e.y-i.top)/n.scale}}function s(t,n){n=n||r;var i=e.createEvent(G({},n.payload,n.data,{isTouch:n.isTouch}));return!1!==e.fire("drag."+t,i)&&e.fire(n.prefix+"."+t,i)}function c(e,i){var o=r.payload,c=r.displacement,l=r.globalStart,p=rP(e),u=oo(p,l),h=r.localStart,d=a(p),f=oo(d,h);if(!r.active&&(i||Math.sqrt(Math.pow(u.x,2)+Math.pow(u.y,2))>r.threshold)){if(G(o,{x:ap(h.x+c.x),y:ap(h.y+c.y),dx:0,dy:0},{originalEvent:e}),!1===s("start"))return m();r.active=!0,r.keepSelection||(o.previousSelection=n.get(),n.select(null)),r.cursor&&on(r.cursor),t.addMarker(t.getRootElement(),au)}rR(e),r.active&&(G(o,{x:ap(d.x+c.x),y:ap(d.y+c.y),dx:ap(f.x),dy:ap(f.y)},{originalEvent:e}),s("move"))}function l(e){var t=!0;r.active&&(e&&(r.payload.originalEvent=e,rR(e)),t=s("end")),!1===t&&s("rejected"),s("ended",g(!0!==t))}function p(e){r1("Escape",e)&&(ah(e),m())}function u(t){r.active&&(setTimeout(oi(e),400),ah(t)),l(t)}function h(e){c(e)}function d(e){var t=r.payload;t.hoverGfx=e.gfx,t.hover=e.element,s("hover")}function f(e){s("out");var t=r.payload;t.hoverGfx=null,t.hover=null}function m(e){if(r){var t,n=r.active;n&&s("cancel"),t=g(e),n&&s("canceled",t)}}function g(o){s("cleanup"),on(null),y=r.trapClick?u:l,en.unbind(document,"mousemove",c),en.unbind(document,"dragstart",ah),en.unbind(document,"selectstart",ah),en.unbind(document,"mousedown",y,!0),en.unbind(document,"mouseup",y,!0),en.unbind(document,"keyup",p),en.unbind(document,"touchstart",h,!0),en.unbind(document,"touchcancel",m,!0),en.unbind(document,"touchmove",c,!0),en.unbind(document,"touchend",l,!0),e.off("element.hover",d),e.off("element.out",f),t.removeMarker(t.getRootElement(),au);var a,g,y,v=r.payload.previousSelection;return!1!==o&&v&&!n.get().length&&(a=v.filter(function(e){return i.get(e.id)})).length&&n.select(a),g=r,r=null,g}e.on("diagram.destroy",m),this.init=function(t,n,i,g){r&&m(!1),"string"==typeof n&&(g=i,i=n,n=null);var y,v,b,_,x,w,E=(g=G({},o,g||{})).data||{};if(x=g.trapClick?u:l,t?(v=rC(t)||t,b=rP(t),rR(t),"dragstart"===v.type&&ah(v)):(v=null,b={x:0,y:0}),_=a(b),n||(n=_),y=v,w="u">typeof TouchEvent&&y instanceof TouchEvent,r=G({prefix:i,data:E,payload:{},globalStart:b,displacement:oo(n,_),localStart:_,isTouch:w},g),g.manual||(w?(en.bind(document,"touchstart",h,!0),en.bind(document,"touchcancel",m,!0),en.bind(document,"touchmove",c,!0),en.bind(document,"touchend",l,!0)):(en.bind(document,"mousemove",c),en.bind(document,"dragstart",ah),en.bind(document,"selectstart",ah),en.bind(document,"mousedown",x,!0),en.bind(document,"mouseup",x,!0)),en.bind(document,"keyup",p),e.on("element.hover",d),e.on("element.out",f)),!1===s("init"))return m(),!1;g.autoActivate&&c(t,!0)},this.move=c,this.hover=d,this.out=f,this.end=l,this.cancel=m,this.context=function(){return r},this.setOptions=function(e){G(o,e)}}ad.$inject=["eventBus","canvas","selection","elementRegistry"];let af={__depends__:[{__init__:["hoverFix"],hoverFix:["type",al]},rG],dragging:["type",ad]};function am(e,t,n){this._canvas=n,this._opts=G({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10}
354,e);var i=this;t.on("drag.move",function(e){var t=i._toBorderPoint(e);i.startScroll(t)}),t.on(["drag.cleanup"],function(){i.stopScroll()})}function ag(e){this._commandStack=e.get("commandStack",!1)}am.$inject=["config.autoScroll","eventBus","canvas"],am.prototype.startScroll=function(e){var t,n,i,r=this._canvas,o=this._opts,a=this,s=r.getContainer().getBoundingClientRect(),c=[e.x,e.y,s.width-e.x,s.height-e.y];this.stopScroll();for(var l=0,p=0,u=0;u<4;u++){t=c[u],n=o.scrollThresholdOut[u],i=o.scrollThresholdIn[u],n<t&&t<i&&(0===u?l=o.scrollStep:1==u?p=o.scrollStep:2==u?l=-o.scrollStep:3==u&&(p=-o.scrollStep))}(0!==l||0!==p)&&(r.scroll({dx:l,dy:p}),this._scrolling=setTimeout(function(){a.startScroll(e)},o.scrollRepeatTimeout))},am.prototype.stopScroll=function(){clearTimeout(this._scrolling)},am.prototype.setOptions=function(e){this._opts=G({},this._opts,e)},am.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect(),n=rP(e.originalEvent);return{x:n.x-t.left,y:n.y-t.top}},ag.$inject=["injector"],ag.prototype.allowed=function(e,t){var n=!0,i=this._commandStack;return i&&(n=i.canExecute(e,t)),void 0===n||n};let ay={__init__:["rules"],rules:["type",ag]};var av=Math.round,ab=Math.max;function a_(e,t){return function(e,t){var n,i;for(n=0;i=e[n];n++)if(10>=tt(i,t))return{point:e[n],bendpoint:!0,index:n};return null}(e,t)||function(e,t){var n,i,r=tk([["M",t.x,t.y],["m",0,-10],["a",10,10,0,1,1,0,20],["a",10,10,0,1,1,0,-20],["z"]],(n=[],e.forEach(function(e,t){n.push([0===t?"M":"L",e.x,e.y])}),n)),o=r[0],a=r[r.length-1];return o?o!==a?o.segment2!==a.segment2?{point:e[i=ab(o.segment2,a.segment2)-1],bendpoint:!0,index:i}:{point:{x:av(o.x+a.x)/2,y:av(o.y+a.y)/2},index:o.segment2}:{point:{x:av(o.x),y:av(o.y)},index:o.segment2}:null}(e,t)}function ax(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function aw(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function aE(e,t){var n,i,r,o,a=t[0],s=t[1],c={x:s.x-a.x,y:s.y-a.y},l=(n=[a.x,a.y],i=[c.x,c.y],r=[e.x,e.y],-((o=[{n:n[0]-r[0],lambda:i[0]},{n:n[1]-r[1],lambda:i[1]}])[0].n*i[0]+o[1].n*i[1])/(o[0].lambda*i[0]+o[1].lambda*i[1]));return{x:a.x+l*c.x,y:a.y+l*c.y}}function aS(e,t){return ax({x:e.x-t.x,y:e.y-t.y})}var ak="djs-bendpoint",aC="djs-segment-dragger";function aR(e,t,n){var i,r,o,a;return a_(t,(r=rP(n),i={x:(o=e._container.getBoundingClientRect()).left,y:o.top},{x:(a=e.viewbox()).x+(r.x-i.x)/a.scale,y:a.y+(r.y-i.y)/a.scale}))}function aP(e,t){var n=ek("g");ev(n).add(ak),ed(e,n);var i=ek("circle");eg(i,{cx:0,cy:0,r:4}),ev(i).add("djs-visual"),ed(n,i);var r=ek("circle");return eg(r,{cx:0,cy:0,r:10}),ev(r).add("djs-hit"),ed(n,r),t&&ev(n).add(t),n}function aA(e,t,n){var i,r,o,a,s,c,l,p,u,h=ek("g"),d=to(t,n),f=ti(t,n);return ed(e,h),ed(h,c=ek("g")),i=t,r=n,o=f,a=r.x-i.x,s=r.y-i.y,l="h"===o?aM(a):aM(s),eg(p=ek("rect"),{x:-9,y:-3,rx:3,width:18,height:6}),ev(p).add("djs-visual"),ed(c,p),eg(u=ek("rect"),{x:-l/2,y:-8.5,width:l,height:17}),ev(u).add("djs-hit"),ed(c,u),ni(c,90*("v"===f)),ev(h).add(aC),ev(h).add("h"===f?"horizontal":"vertical"),nn(h,d.x,d.y),h}function aM(e){return Math.abs(Math.round(2*e/3))}function aT(e,t,n,i,r){function o(e,t,i){en.bind(e,t,function(e){n.triggerMouseEvent(t,e,i),e.stopPropagation()})}function a(e,n){var i=t.getLayer("overlays"),r=es('.djs-bendpoints[data-element-id="'+rd(e.id)+'"]',i);return!r&&n&&(eg(r=ek("g"),{"data-element-id":e.id}),ev(r).add("djs-bendpoints"),ed(i,r),o(r,"mousedown",e),o(r,"click",e),o(r,"dblclick",e)),r}function s(e,t){return es('.djs-segment-dragger[data-segment-idx="'+e+'"]',t)}function c(e,t){t.waypoints.forEach(function(t,n){var i=aP(e);ed(e,i),nn(i,t.x,t.y)}),aP(e,"floating")}function l(e,t){for(var n,i,r,a=t.waypoints,s=1;s<a.length;s++)ti(n=a[s-1],i=a[s])&&(eg(r=aA(e,n,i),{"data-segment-idx":s}),o(r,"mousemove",t))}function p(e){var t=a(e);return t||(c(t=a(e,!0),e),l(t,e)),t}function u(e){var t=a(e);t&&(R(ec("."+aC,t),function(e){eO(e)}),R(ec("."+ak,t),function(e){eO(e)}),l(t,e),c(t,e))}e.on("connection.changed",function(e){u(e.element)}),e.on("connection.remove",function(e){var t=a(e.element);t&&eO(t)}),e.on("element.marker.update",function(e){var t,n=e.element;n.waypoints&&(t=p(n),e.add?ev(t).add(e.marker):ev(t).remove(e.marker))}),e.on("element.mousemove",function(e){var n,i,r,o,c,l,p,u,h,d,f,m,g=e.element,y=g.waypoints;if(y){if(f=a(g,!0),!(m=aR(t,y,e.originalEvent)))return;n=es(".floating",f),i=m.point,n&&(nn(n,i.x,i.y),ev(n).add("positioned")),!m.bendpoint&&(c=s(m.index,f),l=y[m.index-1],p=y[m.index],u=m.point,h=to(l,p),d=ti(l,p),c&&(r=es(".djs-visual",c),o={x:u.x-h.x,y:u.y-h.y},"v"===d&&(o={x:o.y,y:o.x}),nn(r,o.x,o.y)))}}),e.on("element.mousedown",function(e){if(rT(e)){var n=e.originalEvent,o=e.element;if(o.waypoints)return function(e,n){var o,a,s,c,l,p,u,h,d,f,m,g,y,v=n.waypoints,b=aR(t,v,e);if(b&&!1!==(s=n.waypoints,y=!(b.index<=0)&&!b.bendpoint&&(a=ti((o={start:s[b.index-1],end:s[b.index]}).start,o.end))?aM("h"===a?o.end.x-o.start.x:o.end.y-o.start.y)/2:null,f=b.index,m=b.point,g=!(f<=0)&&!b.bendpoint&&(p=to(c=v[f-1],l=v[f]),u=ti(c,l),h=Math.abs(m.x-p.x),d=Math.abs(m.y-p.y),u&&h<=y&&d<=y)?r.start(e,n,b.index):i.start(e,n,b.index,!b.bendpoint)))return!0}(n,o)}}),e.on("selection.changed",function(e){var t=e.newSelection[0];t&&t.waypoints&&p(t)}),e.on("element.hover",function(e){var t=e.element;t.waypoints&&p(t)}),e.on("element.out",function(e){var t=e.element;if(t.waypoints){var n=a(t);if(n){var i=es(".floating",n);i&&ev(i).remove("positioned")}}}),e.on("element.updateId",function(e){var t=e.element,n=e.newId;if(t.waypoints){var i=a(t);i&&eg(i,{"data-element-id":n})}}),this.addHandles=p,this.updateHandles=u,this.getBendpointsContainer=a,this.get
vendor: 3,385 bytes, line 354
354SegmentDragger=s}aT.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];var aB=Math.round,aD="reconnectStart",aj="reconnectEnd",aO="updateWaypoints";function aN(e,t,n,i,r,o){this._injector=e,this.start=function(e,t,o,a){var s,c=n.getGraphics(t),l=t.source,p=t.target,u=t.waypoints,h=(s=a||0!==o?a||o!==u.length-1?aO:aj:aD)===aO?"connection.updateWaypoints":"connection.reconnect",d=r.allowed(h,{connection:t,source:l,target:p});if(!1===d&&(d=r.allowed(h,{connection:t,source:p,target:l})),!1!==d)return i.init(e,"bendpoint.move",{data:{connection:t,connectionGfx:c,context:{allowed:d,bendpointIndex:o,connection:t,source:l,target:p,insert:a,type:s}}})},t.on("bendpoint.move.hover",function(e){var t,n=e.context,i=n.connection,o=i.source,a=i.target,s=e.hover,c=n.type;if(n.hover=s,s){var l=c===aO?"connection.updateWaypoints":"connection.reconnect";if(t=n.allowed=r.allowed(l,{connection:i,source:c===aD?s:o,target:c===aj?s:a})){n.source=c===aD?s:o,n.target=c===aj?s:a;return}!1===t&&(t=n.allowed=r.allowed(l,{connection:i,source:c===aj?s:a,target:c===aD?s:o})),t&&(n.source=c===aj?s:a,n.target=c===aD?s:o)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(e){var t=e.context,n=t.type;t.hover=null,t.source=null,t.target=null,n!==aO&&(t.allowed=!1)}),t.on("bendpoint.move.end",function(e){var t=e.context,n=t.allowed,i=t.bendpointIndex,r=t.connection,a=t.insert,s=r.waypoints.slice(),c=t.source,l=t.target,p=t.type,u=t.hints||{},h={x:aB(e.x),y:aB(e.y)};if(!n)return!1;p===aO?(a?s.splice(i,0,h):s[i]=h,u.bendpointMove={insert:a,bendpointIndex:i},s=this.cropWaypoints(r,s),o.updateWaypoints(r,function(e){e=e.slice();for(var t,n,i,r=0;e[r];)t=e[r],n=e[r-1],0===tt(t,i=e[r+1])||tn(n,i,t)?e.splice(r,1):r++;return e}(s),u)):(p===aD?(u.docking="source",aL(t)&&(u.docking="target",u.newWaypoints=s.reverse())):p===aj&&(u.docking="target",aL(t)&&(u.docking="source",u.newWaypoints=s.reverse())),o.reconnect(r,c,l,h,u))},this)}function aL(e){var t=e.hover,n=e.source,i=e.target,r=e.type;return r===aD?t&&i&&t===i&&n!==i:r===aj?t&&n&&t===n&&n!==i:void 0}aN.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],aN.prototype.cropWaypoints=function(e,t){var n=this._injector.get("connectionDocking",!1);if(!n)return t;var i=e.waypoints;return e.waypoints=t,e.waypoints=n.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=i,t};var a$="updateWaypoints",aI="connect-ok",aF="connect-not-ok",az="connect-hover",aH="djs-updating",aV="djs-dragging";function aG(e,t,n,i){this._injector=t;var r=t.get("connectionPreview",!1);n.on("bendpoint.move.start",function(e){var t=e.context,n=t.bendpointIndex,r=t.connection,o=t.insert,a=r.waypoints,s=a.slice();t.waypoints=a,o&&s.splice(n,0,{x:e.x,y:e.y}),r.waypoints=s,ev(t.draggerGfx=aP(i.getLayer("overlays"))).add("djs-dragging"),i.addMarker(r,aV),i.addMarker(r,aH)}),n.on("bendpoint.move.hover",function(e){var t=e.context,n=t.allowed,r=t.hover,o=t.type;if(r){if(i.addMarker(r,az),o===a$)return;n?(i.removeMarker(r,aF),i.addMarker(r,aI)):!1===n&&(i.removeMarker(r,aI),i.addMarker(r,aF))}}),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],1100,function(e){var t=e.context,n=t.hover,r=t.target;n&&(i.removeMarker(n,az),i.removeMarker(n,r?aI:aF))}),n.on("bendpoint.move.move",function(t){var n=t.context,i=n.allowed,o=n.bendpointIndex,a=n.draggerGfx,s=n.hover,c=n.type,l=n.connection,p=l.s
354ource,u=l.target,h=l.waypoints.slice(),d={x:t.x,y:t.y},f=n.hints||{},m={};r&&(f.connectionStart&&(m.connectionStart=f.connectionStart),f.connectionEnd&&(m.connectionEnd=f.connectionEnd),"reconnectStart"===c?aL(n)?(m.connectionEnd=m.connectionEnd||d,m.source=u,m.target=s||p,h=h.reverse()):(m.connectionStart=m.connectionStart||d,m.source=s||p,m.target=u):"reconnectEnd"===c?aL(n)?(m.connectionStart=m.connectionStart||d,m.source=s||u,m.target=p,h=h.reverse()):(m.connectionEnd=m.connectionEnd||d,m.source=p,m.target=s||u):(m.noCropping=!0,m.noLayout=!0,h[o]=d),c===a$&&(h=e.cropWaypoints(l,h)),m.waypoints=h,r.drawPreview(n,i,m)),nn(a,t.x,t.y)},this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],1100,function(e){var t=e.context,n=t.connection,o=t.draggerGfx,a=t.hover,s=t.target;n.waypoints=t.waypoints,eO(o),i.removeMarker(n,aH),i.removeMarker(n,aV),a&&(i.removeMarker(a,aI),i.removeMarker(a,s?aI:aF)),r&&r.cleanUp(t)})}aG.$inject=["bendpointMove","injector","eventBus","canvas"];var aW="connect-hover",aU="djs-updating";function aq(e,t,n){return{x:"x"===t?n:e.x,y:"y"===t?n:e.y}}function aK(e){return"x"===e?"y":"x"}function aY(e,t,n){var i,r;return e.original?e.original:(i=tO(t),aq(e,r=aK(n),i[r]))}function aX(e,t,n,i,r,o){var a=e.get("connectionDocking",!1);function s(e,t){if(!a)return t;var n,i=e.waypoints;return e.waypoints=t,n=a.getCroppedWaypoints(e),e.waypoints=i,n}function c(e){r.update("connection",e.connection,e.connectionGfx)}this.start=function(e,t,r){var o,a,s,c,l=n.getGraphics(t),p=r-1,u=t.waypoints,h=u[p],d=u[r],f=aR(n,u,e);if(a=ti(h,d))return s="v"===a?"x":"y",0===p&&(h=aY(h,t.source,s)),r===u.length-1&&(d=aY(d,t.target,s)),c=f?f.point:{x:(h.x+d.x)/2,y:(h.y+d.y)/2},o={connection:t,segmentStartIndex:p,segmentEndIndex:r,segmentStart:h,segmentEnd:d,axis:s,dragPosition:c},i.init(e,c,"connectionSegment.move",{cursor:"x"===s?"resize-ew":"resize-ns",data:{connection:t,connectionGfx:l,context:o}})},t.on("connectionSegment.move.start",function(e){var t=e.context,i=e.connection,r=n.getLayer("overlays");t.originalWaypoints=i.waypoints.slice(),t.draggerGfx=aA(r,t.segmentStart,t.segmentEnd),ev(t.draggerGfx).add("djs-dragging"),n.addMarker(i,aU)}),t.on("connectionSegment.move.move",function(e){var t,n,i,r,o,a,l,p,u,h,d,f,m=e.context,g=m.connection,y=m.segmentStartIndex,v=m.segmentEndIndex,b=m.segmentStart,_=m.segmentEnd,x=m.axis,w=m.originalWaypoints.slice(),E=(t=e["d"+x],aq(b,x,b[x]+t)),S=(n=e["d"+x],aq(_,x,_[x]+n)),k=w.length,C=0;w[y]=E,w[v]=S,y<2&&(d=tN(g.source,E),1===y?"intersect"===d&&(w.shift(),w[0]=E,C--):"intersect"!==d&&(w.unshift(b),C++)),v>k-3&&(f=tN(g.target,S),v===k-2?"intersect"===f&&(w.pop(),w[w.length-1]=S):"intersect"!==f&&w.push(_)),m.newWaypoints=g.waypoints=s(g,w),i=C,o=(r=m.newWaypoints)[m.segmentStartIndex+i],a=r[m.segmentEndIndex+i],l=aK(m.axis),p=Math.max(o[l],a[l]),u=Math.min(Math.max(Math.min(o[l],a[l])+20,e[l]),p-20),h=aq(o,l,u),nn(m.draggerGfx,h.x,h.y),m.newSegmentStartIndex=y+C,c(e)}),t.on("connectionSegment.move.hover",function(e){e.context.hover=e.hover,n.addMarker(e.hover,aW)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(e){var t=e.context.hover;t&&n.removeMarker(t,aW)}),t.on("connectionSegment.move.cleanup",function(e){var t=e.context,i=t.connection;t.draggerGfx&&eO(t.draggerGfx),n.removeMarker(i,aU)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(e){var t=e.context;t.connection.waypoints=t.originalWaypoints,c(e)}),t.on("connectionSegment.move.end",function(e){var t,n,i=e.context,r=i.connection,a=i.newWaypoints,c=i.newSegmentStartIndex,l=(t=a=a.map(function(e){return{original:e.original,x:Math.round(e.x),y:Math.round(e.y)}}),n=0,{waypoints:t.filter(function(e,i){return!tn(t[i-1],t[i+1],e)||(n=i<=c?n-1:n,!1)}),segmentOffset:n}),p=s(r,l.waypoints),u=l.segmentOffset,h={segmentMove:{segmentStartIndex:i.segmentStartIndex,newSegmentStartIndex:c+u}};o.updateWaypoints(r,p,h)})}aX.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];
354var aZ=Math.abs,aJ=Math.round;function aQ(e){return{x:e.x,y:e.y}}function a0(e){return{x:e.x+e.width,y:e.y+e.height}}function a1(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:aJ(e.x+e.width/2),y:aJ(e.y+e.height/2)}}function a2(e,t){var n=e.snapped;return!!n&&("string"==typeof t?n[t]:n.x&&n.y)}function a5(e,t,n){if("string"!=typeof t)throw Error("axis must be in [x, y]");if("number"!=typeof n&&!1!==n)throw Error("value must be Number or false");var i,r=e[t],o=e.snapped=e.snapped||{};return!1===n?o[t]=!1:(o[t]=!0,i=n-r,e[t]+=i,e["d"+t]+=i),r}function a3(e){return e.children||[]}var a6=Math.abs,a9=Math.round;function a4(e){function t(e,t){if(v(e)){for(var n=e.length;n--;)if(10>=a6(e[n]-t))return e[n]}else{var i=t%(e*=1);if(i<10)return t-i;if(i>e-10)return t-i+e}return t}function n(e,t){if(e.waypoints){var n;return n=function(e,t){for(var n,i=t.waypoints,r=1/0,o=0;o<i.length-1;o++){var a=function(e,t){var n=aE(e,t);return ax({x:n.x-e.x,y:n.y-e.y})}(e,[i[o],i[o+1]]);a<r&&(r=a,n=o)}return[i[n],i[n+1]]}(t,e),aE(t,n)}if(e.width)return{x:a9(e.width/2+e.x),y:a9(e.height/2+e.y)}}e.on("connectionSegment.move.move",1500,function(e){var i,r,o=function(e){var t=e.context,i=t.snapPoints,r=t.connection,o=r.waypoints,a=t.segmentStart,s=t.segmentStartIndex,c=t.segmentEnd,l=t.segmentEndIndex,p=t.axis;if(i)return i;var u=[o[s-1],a,c,o[l+1]];return s<2&&u.unshift(n(r.source,e)),l>o.length-3&&u.unshift(n(r.target,e)),t.snapPoints=i={horizontal:[],vertical:[]},R(u,function(e){e&&(e=e.original||e,"y"===p&&i.horizontal.push(e.y),"x"===p&&i.vertical.push(e.x))}),i}(e),a=e.x,s=e.y;if(o){i=t(o.vertical,a),r=t(o.horizontal,s);var c=a-i,l=s-r;G(e,{dx:e.dx-c,dy:e.dy-l,x:i,y:r}),(c||-1!==o.vertical.indexOf(a))&&a5(e,"x",i),(l||-1!==o.horizontal.indexOf(s))&&a5(e,"y",r)}}),e.on(["connect.hover","connect.move","connect.end"],1500,function(e){var t=e.context.hover,i=t&&n(t,e);tA(t)&&i&&i.x&&i.y&&(a5(e,"x",i.x),a5(e,"y",i.y))}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(e){var i,r,o=e.context,a=function(e){var t=e.snapPoints,n=e.connection.waypoints,i=e.bendpointIndex;if(t)return t;var r=[n[i-1],n[i+1]];return e.snapPoints=t={horizontal:[],vertical:[]},R(r,function(e){e&&(e=e.original||e,t.horizontal.push(e.y),t.vertical.push(e.x))}),t}(o),s=o.hover,c=s&&n(s,e),l=e.x,p=e.y;if(a){i=t(c?a.vertical.concat([c.x]):a.vertical,l),r=t(c?a.horizontal.concat([c.y]):a.horizontal,p);var u=l-i,h=p-r;G(e,{dx:e.dx-u,dy:e.dy-h,x:e.x-u,y:e.y-h}),(u||-1!==a.vertical.indexOf(l))&&a5(e,"x",i),(h||-1!==a.horizontal.indexOf(p))&&a5(e,"y",r)}})}function a8(e,t,n,i){function r(e,t){return i.allowed("connection.create",{source:e,target:t})}e.on("connect.hover",function(e){var t,n=e.context,i=n.start,o=e.hover;if(n.hover=o,!y(t=n.canExecute=r(i,o))){if(!1!==t){n.source=i,n.target=o;return}y(t=n.canExecute=r(o,i))||!1!==t&&(n.source=o,n.target=i)}}),e.on(["connect.out","connect.cleanup"],function(e){var t=e.context;t.hover=null,t.source=null,t.target=null,t.canExecute=!1}),e.on("connect.end",function(e){var t=e.context,i=t.canExecute,r=t.connectionStart,o={x:e.x,y:e.y},a=t.source,s=t.target;if(!i)return!1;var c=null,l={connectionStart:a7(t)?o:r,connectionEnd:a7(t)?r:o};b(i)&&(c=i),t.connection=n.connect(a,s,c,l)}),this.start=function(e,n,i,r){b(i)||(r=i,i=tO(n)),t.init(e,"connect",{autoActivate:r,data:{shape:n,context:{start:n,connectionStart:i}}})}}function a7(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}a4.$inject=["eventBus"],a8.$inject=["eventBus","dragging","modeling","rules"];var se="connect-ok",st="connect-not-ok";function sn(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",function(e){var t=e.context,n=t.canExecute,r=t.hover,o=t.source,a=t.start,s=t.startPosition,c=t.target,l=t.connectionStart||s,p=t.connectionEnd||{x:e.x,y:e.y},u=l,h=p;a7(t)&&(u=p,h=l),i.drawPreview(t,n,{source:o||a,target:c||r,connectionStart:u,connectionEnd:h})}),t.on("connect.hover",900,function(e){var t=e.context,i=e.hover,r=t.canExecute;null!==r&&n.addMarker(i,r?se:st)}),t.on(["connect.out","connect.cleanup"],1100,function(e){var t=e.hover;t&&(n.removeMarker(t,se),n.removeMarker(t,st))}),i&&t.on("connect.cleanup",function(e){i.cleanUp(e.context)})}sn.$inject=["injector","eventBus","canvas"];let si={__depends__:[rG,ay,af],__init__:["connectPreview"],connect:["type",a8],connectPreview:["type",sn]};function sr(e,t,n,i){this._canvas=t,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}sr.$inject=["injector","canvas","graphicsFactory","elementFactory"],sr.prototype.drawPreview=function(e,t,n){n=n||{};var i,r,o,a=e.connectionPreviewGfx,s=e.getConnection,c=n.source,l=n.target,p=n.waypoints,u=n.connectionStart,h=n.connectionEnd,d=n.noLayout,f=n.noCropping,m=n.noNoop,g=this;if(a||(a=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),e_(a),s||(i=function(e,t,n){return g.getConnection(e,t,n)},r={},s=e.getConnection=function(e){var t=JSON.stringify(e),n=r[t];return n||(n=r[t]=i.apply(null,arguments)),n}),t&&(o=s(t,c,l)),!o){m||this.drawNoopPreview(a,n);return}o.waypoints=p||[],this._layouter&&!d&&(o.waypoints=this._layouter.layoutConnection(o,{source:c,target:l,connectionStart:u,connectionEnd:h,wayp
354oints:n.waypoints||o.waypoints})),o.waypoints&&o.waypoints.length||(o.waypoints=[c?tO(c):u,l?tO(l):h]),this._connectionDocking&&(c||l)&&!f&&(o.waypoints=this._connectionDocking.getCroppedWaypoints(o,c,l)),this._graphicsFactory.drawConnection(a,o,{stroke:"var(--element-dragger-color)"})},sr.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||tO(n),o=t.connectionEnd||tO(i),a=this.cropWaypoints(r,o,n,i);ed(e,this.createNoopConnection(a[0],a[1]))},sr.prototype.cropWaypoints=function(e,t,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),s=r.getConnectionPath({waypoints:[e,t]});return[e=n&&tL(o,s,!0)||e,t=i&&tL(a,s,!1)||t]},sr.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&eO(e.connectionPreviewGfx)},sr.prototype.getConnection=function(e){var t,n=b(t=e)?t:{};return this._elementFactory.createConnection(n)},sr.prototype.createConnectionPreviewGfx=function(){var e=ek("g");return eg(e,{pointerEvents:"none"}),ev(e).add("djs-dragger"),ed(this._canvas.getActiveLayer(),e),e},sr.prototype.createNoopConnection=function(e,t){return eX([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};let so=new rt("ps");var sa=["marker-start","marker-mid","marker-end"],ss=["circle","ellipse","line","path","polygon","polyline","path","rect"];function sc(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i}sc.$inject=["elementRegistry","eventBus","canvas","styles"],sc.prototype.cleanUp=function(){console.warn("PreviewSupport#cleanUp is deprecated and will be removed in future versions. You do not need to manually clean up previews anymore. cf. https://github.com/bpmn-io/diagram-js/pull/906")},sc.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},sc.prototype.addDragger=function(e,t,n,i="djs-dragger"){var r=ex(n=n||this.getGfx(e));return this._cloneMarkers(ne(r),i),eg(r,this._styles.cls(i,[])),ed(t,r),eg(r,"data-
354preview-support-element-id",e.id),r},sc.prototype.addFrame=function(e,t){var n=ek("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return ed(t,n),eg(n,"data-preview-support-element-id",e.id),n},sc.prototype._cloneMarkers=function(e,t="djs-dragger",n=e){var i,r=this;e.childNodes&&e.childNodes.forEach(e=>{r._cloneMarkers(e,t,n)}),i=e,-1!==ss.indexOf(i.nodeName)&&sa.forEach(function(i){if(eg(e,i)){var o,a,s,c=(o=e,a=i,s=r._canvas.getContainer(),es("marker#"+eg(o,a).match(/url\(['"]?#([^'"]*)['"]?\)/)[1],s||document));c&&r._cloneMarker(n,e,c,i,t)}})},sc.prototype._cloneMarker=function(e,t,n,i,r="djs-dragger"){var o=[n.id,r,so.next()].join("-"),a=es("marker#"+n.id,e);e=e||this._canvas._svg;var s=a||ex(n);s.id=o,ev(s).add(r);var c=es(":scope > defs",e);c||ed(e,c=ek("defs")),ed(c,s),eg(t,i,"url(#"+s.id+")")};let sl={__init__:["previewSupport"],previewSupport:["type",sc]},sp="complex-preview";class su{constructor(e,t,n){this._canvas=e,this._graphicsFactory=t,this._previewSupport=n,this._markers=[]}create(e){this.cleanUp();let{created:t=[],moved:n=[],removed:i=[],resized:r=[]}=e,o=this._canvas.getLayer(sp);t.filter(e=>!e.hidden).forEach(e=>{let t;tA(e)?(t=this._graphicsFactory._createContainer("connection",ek("g")),this._graphicsFactory.drawConnection(ne(t),e)):(t=this._graphicsFactory._createContainer("shape",ek("g")),this._graphicsFactory.drawShape(ne(t),e),nn(t,e.x,e.y)),this._previewSupport.addDragger(e,o,t)}),n.forEach(({element:e,delta:t})=>{this._previewSupport.addDragger(e,o,void 0,"djs-dragging"),this._canvas.addMarker(e,"djs-element-hidden"),this._markers.push([e,"djs-element-hidden"]);let n=this._previewSupport.addDragger(e,o);tA(e)?nn(n,t.x,t.y):nn(n,e.x+t.x,e.y+t.y)}
354),i.forEach(e=>{this._previewSupport.addDragger(e,o,void 0,"djs-dragging"),this._canvas.addMarker(e,"djs-element-hidden"),this._markers.push([e,"djs-element-hidden"])}),r.forEach(({shape:e,bounds:t})=>{this._canvas.addMarker(e,"djs-hidden"),this._markers.push([e,"djs-hidden"]),this._previewSupport.addDragger(e,o,void 0,"djs-dragging");let n=this._graphicsFactory._createContainer("shape",ek("g"));this._graphicsFactory.drawShape(ne(n),e,{width:t.width,height:t.height}),nn(n,t.x,t.y),this._previewSupport.addDragger(e,o,n)})}cleanUp(){e_(this._canvas.getLayer(sp)),this._markers.forEach(([e,t])=>this._canvas.removeMarker(e,t)),this._markers=[]}show(){this._canvas.showLayer(sp)}hide(){this._canvas.hideLayer(sp)}}su.$inject=["canvas","graphicsFactory","previewSupport"];var sh=["top","bottom","left","right"];function sd(e,t){function n(e){if(!(!iO(e)||tA(e)||iu(e,"bpmn:Group"))){var n=function(e){var t=tO(e.label),n=function(e,t){return tN(t,e,5)}(tO(e),t);if(r=n,-1!==sh.indexOf(r)){var i=(o=tO(e),[].concat(e.incoming.map(function(e){return e.waypoints[e.waypoints.length-2]}),e.outgoing.map(function(e){return e.waypoints[1]})).map(function(e){return function(e,t){return tN(t,e,5)}(o,e)}));if(e.host){var r,o,a,s,c,l=(s=e.host,a=(c=tN(tO(e),s)).indexOf("-")>=0?c.split("-"):[c],sh.filter(function(e){return -1===a.indexOf(e)}));i=i.concat(l)}var p=sh.filter(function(e){return -1===i.indexOf(e)});if(-1!==p.indexOf(n)){if("intersect"!==tN(e.label,e))return;return n}return p[0]}}(e);n&&function(e,n){var i,r=tO(e),o=e.label,a=tO(o);if(o.parent){var s=tD(e);switch(n){case"top":i={x:r.x,y:s.top-10-o.height/2};break;case"left":i={x:s.left-10-o.width/2,y:r.y};break;case"bottom":i={x:r.x,y:s.bottom+10+o.height/2};break;case"right":i={x:s.right+10+o.width/2,y:r.y}}var c=oo(i,a);t.moveShape(o,c)}}(e,n)}}rp.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(e){var t=e.context,i=t.connection,r=i.source,o=i.target;!1!==(t.hints||{}).createElementsBehavior&&(n(r),n(o))}),this.postExecuted(["label.create"],function(e){var t=e.context,i=t.shape;!1!==(t.hints||{}).createElementsBehavior&&n(i.labelTarget)}),this.postExecuted(["elements.create"],function(e){var t=e.context,i=t.elements;!1!==(t.hints||{}).createElementsBehavior&&i.forEach(function(e){n(e)})})}function sf(e){rp.call(this,e),this.preExecute("shape.append",function(e){var t=e.source,n=e.shape;e.position||(iu(n,"bpmn:TextAnnotation")?e.position={x:t.x+t.width/2+75,y:t.y-50-n.height/2}:e.position={x:t.x+t.width+80+n.width/2,y:t.y+t.height/2})},!0)}function sm(e,t,n){function i(e){var t=C(e,e=>iu(e,"bpmn:Participant")||iu(e,"bpmn:SubProcess"));if(!t.length)return[];var i=new Set(n.getRootElement().children.filter(e=>iu(e,"bpmn:Artifact"))),r=new Set;return R(t,e=>{let t=new Set(D(e5(Array.from(i),e2(e))));r=r.union(t),i=i.difference(t)}),Array.from(r)}e.invoke(rp,this),this.preExecute("elements.delete",1500,function(e){var t=e.context,n=t.elements,r=i(n);r.length&&(t.elements=n.concat(r))}),t.on("shape.move.start",function(e){var t=e.context.shapes,n=i(t);n.length&&(e.context.shapes=t.concat(n))})}function sg(e,t){e.invoke(rp,this),this.postExecute("shape.move",function(e){var n=e.newParent,i=e.shape;R(C(i.incoming.concat(i.outgoing),function(e){return iu(e,"bpmn:Association")}),function(e){t.moveConnection(e,{x:0,y:0},n)})},!0)}function sy(e,t){t.invoke(rp,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,function(e){var t=e.elements;1===(t=t.filter(function(e){var t=e.host;return sv(e,t)})).length&&t.map(function(e){return t.indexOf(e)}).forEach(function(i){var r=t[i];e.elements[i]=n._replaceShape(t[i],r)})},!0),this.preExecute("elements.move",500,function(e){var t=e.shapes,i=e.newHost;if(1===t.length){var r=t[0];sv(r,i)&&(e.shapes=[n._replaceShape(r,i)])}},!0)}function sv(e,t){return!tM(e)&&ih(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function sb(e,t){function n(e){return C(e.attachers,function(e){return iu(e,"bpmn:BoundaryEvent")})}rp.call(this,e),this.postExecute("connection.create",function(e){var i=e.context.source,r=e.context.target,o=n(r);iu(i,"bpmn:EventBasedGateway")&&iu(r,"bpmn:ReceiveTask")&&o.length>0&&t.removeElements(o)}),this.postExecute("connection.reconnect",function(e){var i=e.context.oldSource,r=e.context.newSource;iu(i,"bpmn:Gateway")&&iu(r,"bpmn:EventBasedGateway")&&R(r.outgoing,function(e){var i=e.target,r=n(i);iu(i,"bpmn:ReceiveTask")&&r.length>0&&t.removeElements(r)})})}function s_(e){return e.create("bpmn:Category")}function sx(e,t){var n=t.get("categoryValueRef");return n||(n=t.categoryValueRef=e.create("bpmn:CategoryValue")),n.$parent||(n.$parent=s_(e)),n}function sw(e,t,n){function i(e){return t.filter(function(e){return iu(e,"bpm
354n:Group")&&!e.labelTarget}).map(id).filter(function(t){return t!==e})}function r(t,n){var i;t&&n&&(i=e.getDefinitions(),e7(n.get("categoryValue"),t),t.$parent=n,e7(i.get("rootElements"),n),n.$parent=i)}function o(e,t,n){var r,o;t&&!i(n).some(function(e){var n=e.get("categoryValueRef");return n&&n.$parent===t})&&(r=t.$parent)&&(e8(r.get("rootElements"),t),t.$parent=null),e&&!i(n).some(function(t){return t.get("categoryValueRef")===e})&&(o=e.$parent)&&(e8(o.get("categoryValue"),e),e.$parent=null)}n.invoke(rp,this),this.executed(["shape.create","label.create"],function(e){var t=e.labelTarget||e.shape;iu(t,"bpmn:Group")&&!t.labelTarget&&r(e.categoryValue,e.category)},!0),this.reverted(["shape.create","label.create"],function(e){var t=e.labelTarget||e.shape;iu(t,"bpmn:Group")&&!t.labelTarget&&o(e.categoryValue,e.category,id(t))},!0),this.executed(["shape.move","shape.resize"],500,function(e){r(e.categoryValue,e.category)},!0),this.reverted(["shape.move","shape.resize"],function(e){var t=e.shape;e.categoryValue&&o(e.categoryValue,e.category,id(t))},!0),this.executed("group.updateRefs",function(e){sE(e).forEach(function(e){r(e.categoryValue,e.category)})},!0),this.reverted("group.updateRefs",function(e){sE(e).forEach(function(e){o(e.categoryValue,e.category,id(e.groupShape))})},!0),this.executed("shape.delete",function(e){var t=e.shape;iu(t,"bpmn:Group")&&!t.labelTarget&&o(e.categoryValue,e.category,id(t))},!0),this.reverted("shape.delete",function(e){var t=e.shape;iu(t,"bpmn:Group")&&!t.labelTarget&&r(e.categoryValue,e.category)},!0)}function sE(e){var t;return(null==(t=e.updates)?void 0:t.groups)||[]}function sS(e,t,n){function i(e){t.updateProperties(e,{isForCompensation:!0})}function r(e){t.updateProperties(e,{isForCompensation:void 0})}rp.call(this,e),this.preExecute("shape.replace",function(e){let{newData:n,oldShape:i}=e;if(sC(e.oldShape)&&"bpmn:CompensateEventDefinition"!==n.eventDefinitionType||"bpmn:BoundaryEvent"!==n.type){let t=i.outgoing.find(({target:e})=>sk(e));t&&t.target&&(e._connectionTarget=t.target)}else if(!sC(e.oldShape)&&"bpmn:CompensateEventDefinition"===n.eventDefinitionType&&"bpmn:BoundaryEvent"===n.type){let n,r=i.outgoing.find(({target:e})=>sR(e));r&&r.target&&(e._connectionTarget=r.target),n=i.outgoing.filter(e=>iu(e,"bpmn:SequenceFlow")),t.removeElements(n)}},!0),this.postExecuted("shape.replace",function(e){let{_connectionTarget:n,newShape:i}=e;n&&t.connect(i,n)},!0),this.preExecute("connection.create",function(e){var n,r;let o=e.connection,a=e.source,s=e.target;sC(a)&&sR(s)&&(i(s),n=a,r=[o],n.outgoing.filter(e=>iu(e,"bpmn:Association")).filter(e=>sk(e.target)&&!r.includes(e)).forEach(e=>t.removeConnection(e)))},!0),this.postExecuted("connection.delete",function(e){let t=e.source,n=e.target;sC(t)&&sk(n)&&r(n)},!0),this.postExecuted("connection.reconnect",function(e){let t=e.newTarget,n=e.oldSource,o=e.oldTarget;o!==t&&(sk(o)&&r(o),sC(n)&&sR(t)&&i(t))},!0),this.postExecuted("element.updateProperties",function(e){let i,r,{element:o}=e;sk(o)?(function(e){for(let i of e.incoming)n.canConnect(i.source,e)||t.removeConnection(i);for(let i of e.outgoing)n.canConnect(e,i.target)||t.removeConnection(i)}(o),(i=o.attachers.slice()).length&&t.removeElements(i)):sR(o)&&(r=o.incoming.filter(e=>sC(e.source)),t.removeElements(r))},!0)}function sk(e){let t=id(e);return t&&t.get("isForCompensation")}function sC(e){return e&&iu(e,"bpmn:BoundaryEvent")&&iB(e,"bpmn:CompensateEventDefinition")}function sR(e){return e&&iu(e,"bpmn:Activity")&&!iT(e)}function sP(e){e.invoke(rp,this),this.preExecute("shape.create",1500,function(e){var t=e.context,n=t.parent,i=t.shape;iu(n,"bpmn:Lane")&&!iu(i,"bpmn:Lane")&&(t.parent=o7(n,"bpmn:Participant"))})}function sA(e,t){rp.call(this,e),this.preExecute("shape.create",function(e){var n=e.context.shape;if(iu(n,"bpmn:DataObjectReference")&&"label"!==n.type){var i,r=t.create("bpmn:DataObject");r.isCollection=(null==(i=n.businessObject.dataObjectRef)?void 0:i.isCollection)||!1,n.businessObject.dataObjectRef=r}})}function sM(e,t,n){function i(){var t=e.getRootElement();return iu(t,"bpmn:Collaboration")?t:n.makeCollaboration()}rp.call(this,t),t.on(["create.start","shape.move.start"],2e3,function(t){var n=t.context,i=n.shape,r=e.getRootElement();if(iu(i,"bpmn:Participant")&&iu(r,"bpmn:Process")&&r.children.length){var o=r.children.filter(function(e){return!iu(e,"bpm
354n:Group")&&!tM(e)&&!tA(e)});if(o.length){var a,s,c,l,p,u,h=e2(o),d=(a=i,s={width:(s=h).width+40+30,height:s.height+40},c=Math.max(a.width,s.width),{x:-c/2,y:-(l=Math.max(a.height,s.height))/2,width:c,height:l});G(i,d),p=i,n.createConstraints={bottom:(u=tD(u=h)).top+p.height/2-20,left:u.right-p.width/2+20,top:u.bottom-p.height/2+20,right:u.left+p.width/2-20-30}}}}),t.on("create.start",2e3,function(n){var i=n.context.shape,r=e.getRootElement(),o=e.getGraphics(r);function a(e){e.element=r,e.gfx=o}iu(i,"bpmn:Participant")&&iu(r,"bpmn:Process")&&(t.on("element.hover",2e3,a),t.once("create.cleanup",function(){t.off("element.hover",a)}))}),this.preExecute("elements.create",2e3,function(e){var t,n=e.elements,r=e.parent,o=S(n,function(e){return iu(e,"bpmn:Participant")});o&&iu(r,"bpmn:Process")&&(e.parent=i(),(t=e.hints=e.hints||{}).participant=o,t.process=r,t.processRef=id(o).get("processRef"))},!0),this.preExecute("shape.create",function(e){var t=e.parent,n=e.shape;iu(n,"bpmn:Participant")&&iu(t,"bpmn:Process")&&(e.parent=i(),e.process=t,e.processRef=id(n).get("processRef"))},!0),this.execute("shape.create",function(e){var t=e.hints||{},n=e.process||t.process,i=e.shape,r=t.participant;n&&(!r||i===r)&&id(i).set("processRef",id(n))},!0),this.revert("shape.create",function(e){var t=e.hints||{},n=e.process||t.process,i=e.processRef||t.processRef,r=e.shape,o=t.participant;n&&(!o||r===o)&&id(r).set("processRef",i)},!0),this.postExecute("shape.create",function(e){var t=e.hints||{},i=e.process||e.hints.process,r=e.shape,o=t.participant;if(i){var a=i.children.slice();o?r===o&&n.moveElements(a,{x:0,y:0},o):n.moveElements(a,{x:0,y:0},r)}},!0)}i(sd,rp),sd.$inject=["eventBus","modeling"],i(sf,rp),sf.$inject=["eventBus"],i(sm,rp),sm.$inject=["injector","eventBus","canvas"],i(sg,rp),sg.$inject=["injector","modeling"],sy.$inject=["bpmnReplace","injector"],i(sy,rp),sy.prototype._replaceShape=function(e,t){var n,i=(n=id(e).eventDefinitions)&&n[0],r={type:"bpmn:BoundaryEvent",host:t};return i&&(r.eventDefinitionType=i.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})},sb.$inject=["eventBus","modeling"],i(sb,rp),sw.$inject=["bpmnjs","elementRegistry","injector"],i(sw,rp),i(sS,rp),sS.$inject=["eventBus","modeling","bpmnRules"],sP.$inject=["injector"],i(sP,rp),sA.$inject=["eventBus","bpmnFactory"],i(sA,rp),sM.$inject=["canvas","eventBus","modeling"],i(sM,rp);var sT="__targetRef_placeholder";function sB(e,t){function n(e,n){var i=e.get("properties"),r=S(i,function(e){return e.name===sT});return!r&&n&&e7(i,r=t.create("bpmn:Property",{name:sT})),r}function i(e,t){var i=n(e);i&&(S(e.get("dataInputAssociations"),function(e){return e!==t&&e.targetRef===i})||e8(e.get("properties"),i))}function r(e){var t=e.context,r=t.connection,o=r.businessObject,a=r.target,s=a&&a.businessObject,c=t.newTarget,l=c&&c.businessObject,p=t.oldTarget||t.target,u=p&&p.businessObject,h=r.businessObject;u&&u!==s&&i(u,o),l&&l!==s&&i(l,o),s?h.targetRef=n(s,!0):h.targetRef=null}rp.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],sD(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],sD(r))}function sD(e){return function(t){if(iu(t.context.connection,"bpmn:DataInputAssociation"))return e(t)}}function sj(e){this._bpmnUpdater=e}function sO(e,t,n,i){function r(e){return e.children.filter(function(e){return iu(e,"bpmn:DataStoreReference")&&!e.labelTarget})}function o(e,i){var r=e.businessObject||e;if(i=i||n.filter(function(e){return iu(e,"bpmn:Participant")&&id(e).processRef})[0]){var o=i.businessObject||i;t.execute("dataStore.updateContainment",{dataStoreBo:r,dataStoreDi:im(e),newSemanticParent:o.processRef||o,newDiParent:im(i)})}}rp.call(this,i),t.registerHandler("dataStore.updateContainment",sj),this.preExecute("shape.create",function(e){var t=e.context,n=t.shape;iu(n,"bpmn:DataStoreReference")&&"label"!==n.type&&(t.hints||(t.hints={}),t.hints.autoResize=!1)}
354),this.preExecute("elements.move",function(e){var t=e.context,n=t.shapes;n.filter(function(e){return iu(e,"bpmn:DataStoreReference")}).length&&(t.hints||(t.hints={}),t.hints.autoResize=n.filter(function(e){return!iu(e,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(e){var t=e.context.shape,n=t.parent;iu(t,"bpmn:DataStoreReference")&&"label"!==t.type&&iu(n,"bpmn:Collaboration")&&o(t)}),this.postExecute("shape.move",function(e){var t=e.context,n=t.shape,i=t.oldParent,r=n.parent;!iu(i,"bpmn:Collaboration")&&iu(n,"bpmn:DataStoreReference")&&"label"!==n.type&&iu(r,"bpmn:Collaboration")&&o(n,iu(i,"bpmn:Participant")?i:function(e,t){for(;e.parent;){if(iu(e.parent,t))return e.parent;e=e.parent}}(i,"bpmn:Participant"))}),this.postExecute("shape.delete",function(t){var n=t.context.shape,i=e.getRootElement();ih(n,["bpmn:Participant","bpmn:SubProcess"])&&iu(i,"bpmn:Collaboration")&&r(i).filter(function(e){for(var t=e,i=n,r=t.businessObject||t,o=i.businessObject||i;r.$parent;){if(r.$parent===o.processRef||o)return!0;r=r.$parent}return!1}).forEach(function(e){o(e)})}),this.postExecute("canvas.updateRoot",function(e){var t=e.context,n=t.oldRoot,i=t.newRoot;r(n).forEach(function(e){iu(i,"bpmn:Process")&&o(e,i)})})}sB.$inject=["eventBus","bpmnFactory"],i(sB,rp),sj.$inject=["bpmnUpdater"],sj.prototype.execute=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.newSemanticParent,r=e.newDiParent;return e.oldSemanticParent=t.$parent,e.oldDiParent=n.$parent,this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]},sj.prototype.revert=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.oldSemanticParent,r=e.oldDiParent;return this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]},sO.$inject=["canvas","commandStack","elementRegistry","eventBus"],i(sO,rp);var sN=Math.max,sL=Math.min;function s$(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function sI(e,t,n){var i=t[e],r=n.min&&n.min[e],o=n.max&&n.max[e];return _(r)&&(i=(/top|left/.test(e)?sL:sN)(i,r)),_(o)&&(i=(/top|left/.test(e)?sN:sL)(i,o)),i}function sF(e,t){return void 0!==e?e:20}function sz(e){return!e.waypoints&&"label"!==e.type}function sH(e,t){var n,i,r,o,a,s;if((n=void 0===e.length?C(e.children,sz):e).length)return i=e2(n),"object"==typeof t?(r=sF(t.left),o=sF(t.right),a=sF(t.top),s=sF(t.bottom)):r=o=a=s=sF(t),{x:i.x-r,y:i.y-a,width:i.width+r+o,height:i.height+a+s}}var sV=Math.abs,sG=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"];function sW(e,t){return t=t||[],e.children.filter(function(e){iu(e,"bpmn:Lane")&&(sW(e,t),t.push(e))}),t}function sU(e){return e.children.filter(function(e){return iu(e,"bpmn:Lane")})}function sq(e){return o7(e,sG)||e}function sK(e,t){rp.call(this,e),this.postExecuted("shape.delete",500,function(e){var n,i,r,o,a,s,c,l,p,u,h,d=e.context,f=d.hints,m=d.shape,g=d.oldParent;iu(m,"bpmn:Lane")&&(!f||!f.nested)&&(s=iM(m),c=sU(g),l=[],p=[],u=[],h=[],eQ(c,function(e){return s?e.y>m.y?p.push(e):l.push(e):e.x>m.x?h.push(e):u.push(e),e.children}),c.length&&(n=s?p.length&&l.length?m.height/2:m.height:h.length&&u.length?m.width/2:m.width,l.length&&(i=t.calculateAdjustments(l,"y",n,m.y-10),t.makeSpace(i.movingShapes,i.resizingShapes,{x:0,y:n},"s")),p.length&&(r=t.calculateAdjustments(p,"y",-n,m.y+m.height+10),t.makeSpace(r.movingShapes,r.resizingShapes,{x:0,y:-n},"n")),u.length&&(o=t.calculateAdjustments(u,"x",n,m.x-10),t.makeSpace(o.movingShapes,o.resizingShapes,{x:n,y:0},"e")),h.length&&(a=t.calculateAdjustments(h,"x",-n,m.x+m.width+10),t.makeSpace(a.movingShapes,a.resizingShapes,{x:-n,y:0},"w"))))})}function sY(e,t){t.invoke(rp,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,function(e){var t=e.elements;t.filter(function(e){var t=e.host;return sX(e,t)}).map(function(e){return t.indexOf(e)}).forEach(function(i){e.elements[i]=n._replaceShape(t[i])})},!0),this.preExecute("elements.move",500,function(e){var t=e.shapes,i=e.newHost;t.forEach(function(e,r){var o,a,s=e.host;sX(e,(o=t,a=s,-1!==o.indexOf(a))?s:i)&&(t[r]=n._replaceShape(e))})},!0)}
354function sX(e,t){return!tM(e)&&iu(e,"bpmn:BoundaryEvent")&&!t}function sZ(e,t,n){function i(e,i,r){var o,a,s,c,l,p,u,h,d=i.waypoints,f=e.outgoing.slice(),m=e.incoming.slice(),g=a_(d,o=_(r.width)?tO(r):r);if(g){if(a=d.slice(0,g.index),s=d.slice(g.index+ +!!g.bendpoint),!a.length||!s.length)return;c=g.bendpoint?d[g.index]:o,1!==a.length&&sJ(e,a[a.length-1])||a.push(G({},c)),1!==s.length&&sJ(e,s[0])||s.unshift(G({},c))}l=i.source,p=i.target,t.canConnect(l,e,i)&&(n.reconnectEnd(i,e,a||o),u=i),t.canConnect(e,p,i)&&(u?h=n.connect(e,p,{type:i.type,waypoints:s}):(n.reconnectStart(i,e,s||o),h=i));var y=[].concat(u&&C(m,function(e){return e.source===u.source})||[],h&&C(f,function(e){return e.target===h.target})||[]);y.length&&n.removeElements(y)}rp.call(this,e),this.preExecute("elements.move",function(e){var n=e.newParent,i=e.shapes,r=e.delta,o=i[0];if(o&&n){n&&n.waypoints&&(e.newParent=n=n.parent);var a=tO(o),s={x:a.x+r.x,y:a.y+r.y},c=S(n.children,function(e){return t.canInsert(i,e)&&a_(e.waypoints,s)});c&&(e.targetFlow=c,e.position=s)}},!0),this.postExecuted("elements.move",function(e){var t=e.shapes,n=e.targetFlow,r=e.position;n&&i(t[0],n,r)},!0),this.preExecute("shape.create",function(e){var n=e.parent,i=e.shape;t.canInsert(i,n)&&(e.targetFlow=n,e.parent=n.parent)},!0),this.postExecuted("shape.create",function(e){var t=e.shape,n=e.targetFlow,r=e.position;n&&i(t,n,r)},!0)}function sJ(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}sK.$inject=["eventBus","spaceTool"],i(sK,rp),sY.$inject=["bpmnReplace","injector"],i(sY,rp),sY.prototype._replaceShape=function(e){var t,n,i=(t=id(e).eventDefinitions)&&t[0];return n=i?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:i.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,n,{layoutConnection:!1})};function sQ(e,t){rp.call(this,e),this.preExecuted("connection.create",function(e){var n=e.context,i=n.connection,r=n.source,o=n.target,a=n.hints;(!a||!1!==a.createElementsBehavior)&&s0(i)&&(iu(r,"bpmn:EventBasedGateway")?o.incoming.filter(e=>e!==i&&s0(e)):o.incoming.filter(e=>e!==i&&s0(e)&&iu(e.source,"bpmn:EventBasedGateway"))).forEach(function(e){t.removeConnection(e)})}
vendor: 4,434 bytes, line 354
354),this.preExecuted("shape.replace",function(e){var n=e.context.newShape;iu(n,"bpmn:EventBasedGateway")&&n.outgoing.filter(s0).reduce(function(e,t){return e.includes(t.target)?e:e.concat(t.target)},[]).forEach(function(e){e.incoming.filter(s0).forEach(function(i){let r=e.incoming.filter(s0).filter(function(e){return e.source===n});(i.source!==n||r.length>1)&&t.removeConnection(i)})})})}function s0(e){return iu(e,"bpmn:SequenceFlow")}function s1(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],1500,function(t){var i=t.context.shape||t.shape,r=t.hover;iu(r,"bpmn:Lane")&&!ih(i,["bpmn:Lane","bpmn:Participant"])&&(t.hover=sq(r),t.hoverGfx=e.getGraphics(t.hover));var o=n.getRootElement();r&&r!==o&&(i.labelTarget||ih(i,["bpmn:Group","bpmn:TextAnnotation"]))&&(t.hover=o,t.hoverGfx=e.getGraphics(t.hover))}),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],1500,function(t){var n=t.hover;iu(n,"bpmn:Lane")&&(t.hover=sq(n)||n,t.hoverGfx=e.getGraphics(t.hover))}),t.on(["bendpoint.move.hover"],1500,function(t){var n=t.context,i=t.hover,r=n.type;iu(i,"bpmn:Lane")&&/reconnect/.test(r)&&(t.hover=sq(i)||i,t.hoverGfx=e.getGraphics(t.hover))}),t.on(["connect.start"],1500,function(e){var t=e.context,n=t.start;iu(n,"bpmn:Lane")&&(t.start=sq(n)||n)}),t.on("shape.move.start",2e3,function(e){var t=e.shape;iu(t,"bpmn:Lane")&&(e.shape=sq(t)||t)}),t.on("spaceTool.move",2e3,function(e){var t=e.hover;t&&iu(t,"bpmn:Lane")&&(e.hover=sq(t))})}function s2(e,t,n,i){function r(t,n){var i=id(t),r=n.categoryValue||i.categoryValueRef;r||(r=sx(e,i));var o=n.category||r.$parent||s_(e);i.categoryValueRef=r,r.$parent=o,n.categoryValue=r,n.category=o}function o(e,t){var n=id(e),i=t.categoryValue||n.categoryValueRef,r=t.category||i&&i.$parent;i&&(t.categoryValue=i,t.category=r,n.categoryValueRef=null)}function a(t,n){var r=e.create(t.$type);return i.copyElement(t,r,null,n)}n.invoke(rp,this),this.execute("label.create",function(e){var t=e.context,n=t.labelTarget;iu(n,"bpmn:Group")&&r(n,t)}),this.revert("label.create",function(e){var t=e.context,n=t.labelTarget;iu(n,"bpmn:Group")&&o(n,t)}),this.execute("shape.delete",function(e){var t=e.context,n=t.shape,i=id(n);if(iu(n,"bpmn:Group")&&!n.labelTarget){var r=t.categoryValue=i.categoryValueRef;r&&(t.category=r.$parent,i.categoryValueRef=null)}}),this.reverted("shape.delete",function(e){var t=e.context,n=t.shape;if(iu(n,"bpmn:Group")&&!n.labelTarget){var i=t.category,r=t.categoryValue,o=id(n);r&&(o.categoryValueRef=r,r.$parent=i)}}),this.execute("shape.create",function(e){var t=e.context,n=t.shape,i=t.hints||{};!iu(n,"bpmn:Group")||n.labelTarget||(!1!==i.createElementsBehavior||id(n).categoryValueRef||t.categoryValue)&&r(n,t)}),this.reverted("shape.create",function(e){var t=e.context,n=t.shape,i=t.hints||{};!iu(n,"bpmn:Group")||n.labelTarget||(!1!==i.createElementsBehavior||id(n).categoryValueRef||t.categoryValue)&&o(n,t)}),this.executed(["shape.move","shape.resize"],function(e){var t=e.context,n=t.shape;!iu(n,"bpmn:Group")||n.labelTarget||id(n).categoryValueRef||r(n,t)}),this.reverted(["shape.move","shape.resize"],function(e){var t=e.context,n=t.shape;iu(n,"bpmn:Group")&&!n.labelTarget&&t.categoryValue&&o(n,t)}),t.on("copyPaste.copyElement",770,function(e){var t=e.descriptor,n=e.element;if(iu(n,"bpmn:Group")&&!n.labelTarget){var i=id(n);if(i.categoryValueRef){var r=i.categoryValueRef;t.categoryValue=a(r,!0),r.$parent&&(t.category=a(r.$parent,!0))}}}),t.on("copyPaste.pasteElement",770,function(e){var t=e.descriptor,n=t.businessObject,i=t.categoryValue,r=t.category;i&&(i=n.categoryValueRef=a(i)),r&&(i.$parent=a(r)),delete t.category,delete t.categoryValue})}function s5(e,t,n,i){var r,o,a,s;return 0==(r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y))?null:(o=e.y-n.y,a=e.x-n.x,s=((i.x-n.x)*o-(i.y-n.y)*a)/r,{x:Math.round(e.x+s*(t.x-e.x)),y:Math.round(e.y+s*(t.y-e.y))})}function s3(e){function t(e,t,n){var i={x:n.x,y:n.y-50},r={x:n.x-50,y:n.y},o=s5(e,t,n,i),a=s5(e,t,n,r);e.original=o&&a?s6(o,n)>s6(a,n)?a:o:o||a}e.on("bpmnElement.added",function(e){var n,i=e.element;i.waypoints&&(t((n=i.waypoints)[0],n[1],tO(i.source)),t(n[n.length-1],n[n.length-2],tO(i.target)))})}function s6(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function s9(e){rp.call(this,e);
354var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(e){var n=e.context.shape,i=id(n),r=im(n);if(ih(i,t)){var o=r.get("isHorizontal");void 0===o&&(o=!0),r.set("isHorizontal",o)}})}i(sZ,rp),sZ.$inject=["eventBus","bpmnRules","modeling"],sQ.$inject=["eventBus","modeling"],i(sQ,rp),s1.$inject=["elementRegistry","eventBus","canvas"],s2.$inject=["bpmnFactory","eventBus","injector","moddleCopy"],i(s2,rp),s3.$inject=["eventBus"],s9.$inject=["eventBus"],i(s9,rp);var s4=Math.sqrt,s8=Math.min,s7=Math.max,ce=Math.abs;function ct(e){return Math.pow(e,2)}function cn(e,t){return s4(ct(e.x-t.x)+ct(e.y-t.y))}function ci(e,t,n){return e>=s8(t,n)-cr&&e<=s7(t,n)+cr}var cr=.1;function co(e,t){return ce(e.x-t.x)<=cr&&ce(e.y-t.y)<=cr}function ca(e,t,n,i){var r,o,a,s,c,l,p,u,h,d,f,m,g=0,y=0,v={point:e,delta:{x:0,y:0}},b=function(e,t){var n,i,r,o,a,s,c,l,p,u,h,d=0;for(d=0;d<t.length-1;d++){if(co(r=t[d],o=t[d+1])?c=[r]:(s=s8(cn(e,r),cn(e,o)),c=function(e,t,n,i){var r=t.x-e.x,o=t.y-e.y,a=n.x-e.x,s=n.y-e.y,c=r*r+o*o,l=(r*a+o*s)/c,p=l*l-(a*a+s*s-i*i)/c;if(p<0&&p>-1e-6&&(p=0),p<0)return[];var u=s4(p),h=-l+u,d=-l-u,f={x:e.x-r*h,y:e.y-o*h};return 0===p?[f]:[f,{x:e.x-r*d,y:e.y-o*d}].filter(function(n){var i,r,o;return i=n,r=e,o=t,ci(i.x,r.x,o.x)&&ci(i.y,r.y,o.y)})}(r,o,e,s)),c.length<1)throw Error("expected between [1, 2] circle -> line intersections");1===c.length&&(l={type:"bendpoint",position:c[0],segmentIndex:d,bendpointIndex:co(r,c[0])?d:d+1}),2===c.length&&(l={type:"segment",position:(n=c[0],i=c[1],a={x:(n.x+i.x)/2,y:(n.y+i.y)/2}),segmentIndex:d,relativeLocation:cn(r,a)/cn(r,o)}),p=cn(l.position,e),(!h||u>p)&&(h=l,u=p)}return h}(e,n),_=b.segmentIndex,x=function(e,t,n,i){var r=n.segmentIndex,o=t.length-e.length;if(i.segmentMove){var a=i.segmentMove.segmentStartIndex,s=i.segmentMove.newSegmentStartIndex;return r===a?s:r>=s?r+o<s?s:r+o:r}if(i.bendpointMove){var c,l=i.bendpointMove.insert,p=i.bendpointMove.bendpointIndex;return 0===o?r:(r>=p&&(c=l?r+1:r-1),r<p&&(c=r,l&&"bendpoint"!==n.type&&p-1===r&&cs(t,p)<n.relativeLocation&&c++),c)}return 0===o?r:i.connectionStart&&0===r?0:i.connectionEnd&&r===e.length-2?t.length-2:Math.floor((t.length-2)/2)}(n,t,b,i);if(x<0||x>t.length-2||null===x)return v;var w=[(r=n)[o=_],r[o+1]],E=[(a=t)[s=x],a[s+1]],S=b.position,k=(c=w,l=S,p=aS(c[0],c[1]),u=aS(c[0],l),0===p?0:u/p),C=(h=w,d=E,f=aw(h),aw(d)-f);if("bendpoint"===b.type){var R=t.length-n.length,P=b.bendpointIndex,A=n[P];if(-1!==t.indexOf(A))return v;if(0===R){var M=t[P];return{delta:{x:g=M.x-b.position.x,y:y=M.y-b.position.y},point:{x:e.x+g,y:e.y+y}}}R<0&&0!==P&&P<n.length-1&&(k=cs(n,P))}var T={x:(E[1].x-E[0].x)*k+E[0].x,y:(E[1].y-E[0].y)*k+E[0].y},B=(m={x:e.x-S.x,y:e.y-S.y},C?{x:Math.cos(C)*m.x-Math.sin(C)*m.y,y:Math.sin(C)*m.x+Math.cos(C)*m.y}:m);return g=T.x+B.x-e.x,y=T.y+B.y-e.y,{point:tB(T),delta:tB({x:g,y:y})}}function cs(e,t){var n=aS(e[t-1],e[t]);return n/(n+aS(e[t],e[t+1]))}function cc(e,t,n){var i=or(t),r=or(n),o=oo(e,i),a={x:o.x*(n.width/t.width),y:o.y*(n.height/t.height)};return tB({x:r.x+a.x,y:r.y+a.y})}function cl(e,t,n){var i=or(e),r=or(t),o=or(n),a=oo(e,i),s=oo(i,r),c=function(e,t,n){var i=tD(t),r=tD(n);if(o=i,a=r,s=o,c=a,s.right!==c.right&&s.left!==c.left||(l=o,p=a,l.top!==p.top&&l.bottom!==p.bottom))return null;var o,a,s,c,l,p,u,h=tN(t,e);if("top"===h)u={x:0,y:r.bottom-i.bottom};else if("bottom"===h)u={x:0,y:r.top-i.top};else if("right"===h)u={x:r.left-i.left,y:0};else{if("left"!==h)return null;u={x:r.right-i.right,y:0}}return tN(n,{x:e.x+u.x,y:e.y+u.y})!==h?null:u}(i,t,n);if(c)return c;var l={x:s.x*(n.width/t.width),y:s.y*(n.height/t.height)},p={x:o.x+l.x,y:o.y+l.y};return tB({x:p.x+a.x-e.x,y:p.y+a.y-e.y})}function cp(e,t){if(t.length){var n,i=(n=e,N(t.map(function(e){return{line:e,distance:aS(n,cu(n,e))}}),"distance")[0].line);return cu(e,i)}}function cu(e,t){var n=t[0],i=t[1],r=i.x-n.x,o=i.y-n.y,a=r*r+o*o;if(0===a)return{x:n.x,y:n.y};var s=((e.x-n.x)*r+(e.y-n.y)*o)/a;return s=Math.max(0,Math.min(1,s)),{x:n.x+s*r,y:n.y+s*o}}var ch="name",cd="text";function cf(e,t,n,i){function r(e){var n=e.context,r=n.element,o=n.properties;if(ch in o&&t.updateLabel(r,o[ch]),cd in o&&iu(r,"bpmn:TextAnnotation")){var a=i.getTextAnnotationBounds({x:r.x,y:r.y,width:r.width,height:r.height},o[cd]||"");t.updateLabel(r,o.text,a)}}rp.call(this,e),this.postExecute("element.updateProperties",r),this.postExecute("element.updateModdleProperties",e=>{id(e.context.element)===e.context.moddleElement&&r(e)}),this.postExecute(["shape.create","connection.create"],function(e){var n=e.context;if(!1!==(n.hints||{}).createElementsBehavior){var i=n.shape||n.connection;tM(i)||!ij(i)||i$(i)&&t.updateLabel(i,i$(i))}}),this.postExecute("shape.delete",function(e){var n=e.context,i=n.labelTarget,r=n.hints||{};
354i&&!1!==r.unsetLabel&&t.updateLabel(i,null,null,{removeShape:!1})}),this.postExecute(["connection.layout","connection.updateWaypoints"],function(e){var n,i,r,o,a,s,c=e.context;if(!1!==(c.hints||{}).labelBehavior){var l,p=c.connection.label;p&&p.parent&&(r=(i=(n=e.context).connection).label,o=G({},n.hints),a=n.newWaypoints||i.waypoints,s=n.oldWaypoints,void 0===o.startChanged&&(o.startChanged=!!o.connectionStart),void 0===o.endChanged&&(o.endChanged=!!o.connectionEnd),l=ca(tO(r),a,s,o).delta,t.moveShape(p,l))}}),this.postExecute(["shape.replace"],function(e){var t=e.context,n=t.newShape,i=t.oldShape,r=id(n);r&&ij(r)&&i.label&&n.label&&(n.label.x=i.label.x,n.label.y=i.label.y)}),this.preExecute("shape.resize",function(e){var t=e.context,n=t.shape,r=t.hints||{};if(tM(n)&&!r.autoResize){var o=t.newBounds,a=Math.ceil(i.getDimensions(i$(n)||"",{box:o,style:i.getExternalStyle()}).height),s=o.y!==n.y,c=n.y+n.height;t.newBounds={width:o.width,height:a,x:o.x,y:s?c-a:o.y}}}),this.postExecute("shape.resize",function(e){var n=e.context,i=n.shape,r=n.newBounds,o=n.oldBounds;if(iO(i)){var a,s=i.label,c=(a=cp(tO(s),[[{x:o.x,y:o.y},{x:o.x+(o.width||0),y:o.y}],[{x:o.x+(o.width||0),y:o.y},{x:o.x+(o.width||0),y:o.y+(o.height||0)}],[{x:o.x,y:o.y+(o.height||0)},{x:o.x+(o.width||0),y:o.y+(o.height||0)}],[{x:o.x,y:o.y},{x:o.x,y:o.y+(o.height||0)}]]),tB(oo(cc(a,o,r),a)));t.moveShape(s,c)}})}function cm(e,t){function n(e,t){var n=e.context,i=n.connection,r=G({},n.hints),o=n.newWaypoints||i.waypoints,a=n.oldWaypoints;return void 0===r.startChanged&&(r.startChanged=!!r.connectionStart),void 0===r.endChanged&&(r.endChanged=!!r.connectionEnd),ca(t,o,a,r).point}rp.call(this,e),this.postExecute(["connection.layout","connection.updateWaypoints"],function(e){var i=e.context.connection,r=i.outgoing;i.incoming.forEach(function(i){var r=n(e,i.waypoints[i.waypoints.length-1]),o=[].concat(i.waypoints.slice(0,-1),[r]);t.updateWaypoints(i,o)}),r.forEach(function(i){var r=[].concat([n(e,i.waypoints[0])],i.waypoints.slice(1));t.updateWaypoints(i,r)})}),this.postExecute(["connection.move"],function(e){var n=e.context,i=n.connection,r=i.outgoing,o=i.incoming,a=n.delta;o.forEach(function(e){var n=e.waypoints[e.waypoints.length-1],i={x:n.x+a.x,y:n.y+a.y},r=[].concat(e.waypoints.slice(0,-1),[i]);t.updateWaypoints(e,r)}),r.forEach(function(e){var n=e.waypoints[0],i=[].concat([{x:n.x+a.x,y:n.y+a.y}],e.waypoints.slice(1));t.updateWaypoints(e,i)})})}function cg(e,t,n){var i=cx(e),r=cw(i,t),o=i[0];return r.length?r[r.length-1]:cc(o.original||o,n,t)}function cy(e,t,n){var i=cx(e),r=cw(i,t),o=i[i.length-1];return r.length?r[0]:cc(o.original||o,n,t)}function cv(e,t,n){var i=cx(e),r=c_(t,n),o=i[0];return cc(o.original||o,r,t)}function cb(e,t,n){var i=cx(e),r=c_(t,n),o=i[i.length-1];return cc(o.original||o,r,t)}function c_(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function cx(e){var t=e.waypoints;if(!t.length)throw Error("connection#"+e.id+": no waypoints");return t}function cw(e,t){return C(T(e,cE),function(e){return"intersect"===tN(t,e,1)})}function cE(e){return e.original||e}function cS(e,t){rp.call(this,e),this.postExecute("shape.replace",function(e){var n=e.oldShape,i=e.newShape;if(r=n,o=i,iu(r,"bpmn:Participant")&&iA(r)&&iu(o,"bpmn:Participant")&&!iA(o)){var r,o,a,s,c,l,p=(s=e1([a=n],!1),c=[],l=[],s.forEach(function(e){e!==a&&(e.incoming.forEach(function(e){iu(e,"bpmn:MessageFlow")&&c.push(e)}),e.outgoing.forEach(function(e){iu(e,"bpmn:MessageFlow")&&l.push(e)}))},[]),{incoming:c,outgoing:l});p.incoming.forEach(function(e){var r=cy(e,i,n);t.reconnectEnd(e,i,r)}),p.outgoing.forEach(function(e){var r=cg(e,i,n);t.reconnectStart(e,i,r)})}},!0)}i(cf,rp),cf.$inject=["eventBus","modeling","bpmnFactory","textRenderer"],i(cm,rp),cm.$inject=["eventBus","modeling"],cS.$inject=["eventBus","modeling"],i(cS,rp);let ck=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function cC(e){let t=id(e);if(!iu(t,"bpmn:BoundaryEvent")&&!(iu(t,"bpmn:StartEvent")&&iT(t.$parent)))return!1;let n=t.get("eventDefinitions");return!!n&&!!n.length&&ck.some(e=>iu(n[0],e))}
354function cR(e){return iu(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function cP(e,t){e.invoke(rp,this),this.postExecuted("shape.replace",function(e){let n=e.context.oldShape,i=e.context.newShape,r=e.context.hints;if(!cC(i))return;let o=cR(i);if(r.targetElement&&void 0!==r.targetElement[o])return;let a=id(n).get(o);a!==id(i).get(o)&&t.updateProperties(i,{[o]:a})})}function cA(e,t){rp.call(this,e),this.preExecute("shape.resize",function(e){var n=e.shape,i=im(n),r=i&&i.get("label");r&&r.get("bounds")&&t.updateModdleProperties(n,r,{bounds:void 0})},!0)}function cM(e,t,n){rp.call(this,e),this.preExecute("shape.delete",function(e){var i=e.context.shape;if(1===i.incoming.length&&1===i.outgoing.length){var r=i.incoming[0],o=i.outgoing[0];if(iu(r,"bpmn:SequenceFlow")&&iu(o,"bpmn:SequenceFlow")&&t.canConnect(r.source,o.target,r)){var a,s,c,l=(a=r.waypoints,s=o.waypoints,(c=s5(cT(a[a.length-2]),cT(a[a.length-1]),cT(s[1]),cT(s[0])))?[].concat(a.slice(0,a.length-1),[c],s.slice(1)):[cT(a[0]),cT(s[s.length-1])]);n.reconnectEnd(r,o.target,l)}}})}function cT(e){return e.original||e}function cB(e,t){rp.call(this,e),this.preExecute("shape.delete",function(e){var t=e.shape,n=t.parent;iu(t,"bpmn:Participant")&&(e.collaborationRoot=n)},!0),this.postExecute("shape.delete",function(e){var n=e.collaborationRoot;if(n&&!n.businessObject.participants.length){var i=t.makeProcess(),r=n.children.slice();t.moveElements(r,{x:0,y:0},i)}},!0)}function cD(e,t,n,i){rp.call(this,e);var r=i.get("dragging",!1);function o(e){var i,r,o=e.source,a=e.target;e.parent&&(iu(e,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(o,a)||(r=!0),n.canConnectMessageFlow(o,a)&&(i="bpmn:MessageFlow")),iu(e,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(o,a)||(r=!0),n.canConnectSequenceFlow(o,a)&&(i="bpmn:SequenceFlow")),r&&t.removeConnection(e),i&&t.connect(o,a,{type:i,waypoints:e.waypoints.slice()}))}this.postExecuted("elements.move",function(e){R(e.closure.allConnections,o)},!0),this.preExecute("connection.reconnect",function(e){var i,o,a,s,c,l,p,u=e.context,h=u.connection,d=u.newSource||h.source,f=u.newTarget||h.target;(l=n.canConnect(d,f))&&l.type!==h.type&&(p=t.connect(d,f,{type:l.type,associationDirection:l.associationDirection,waypoints:h.waypoints.slice()}),h.parent&&t.removeConnection(h),u.connection=p,r&&(i=h,o=p,(c=(s=r.context())&&s.payload.previousSelection)&&c.length&&-1!==(a=c.indexOf(i))&&c.splice(a,1,o)))}),this.postExecuted("element.updateProperties",function(e){var n,i=e.context,r=i.properties,o=i.element,a=o.businessObject;r.default&&(n=S(o.outgoing,L({id:o.businessObject.default.id})))&&t.updateProperties(n,{conditionExpression:void 0}),r.conditionExpression&&a.sourceRef.default===a&&t.updateProperties(o.source,{default:void 0})})}function cj(e,t,n,i,r,o){i.invoke(rp,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(e){var n=e.context,i=n.parent,r=n.elements,o=P(r,function(e,n){var r=t.canReplace([n],n.host||n.parent||i);return r?e.concat(r.replacements):e},[]);o.length&&this._replaceElements(r,o)},this),this.postExecuted(["elements.move"],500,function(e){var n=e.context,i=n.newParent,r=n.newHost,o=[];R(n.closure.topLevel,function(e){o=iT(e)?o.concat(e.children):o.concat(e)}),1===o.length&&r&&(i=r);var a=t.canReplace(o,i);a&&this._replaceElements(o,a.replacements,r)},this),this.postExecute(["shape.replace"],1500,function(e){var n,i=e.context,r=i.oldShape,o=i.newShape,a=r.attachers;a&&a.length&&(n=t.canReplace(a,o),this._replaceElements(a,n.replacements))},this),this.postExecuted(["shape.replace"],1500,function(e){var t=e.context,n=t.oldShape,i=t.newShape;r.unclaimId(n.businessObject.id,n.businessObject),r.updateProperties(i,{id:n.id})})}cP.$inject=["injector","modeling"],i(cP,rp),i(cA,rp),cA.$inject=["eventBus","modeling"],i(cM,rp),cM.$inject=["eventBus","bpmnRules","modeling"],cB.$inject=["eventBus","modeling"],i(cB,rp),i(cD,rp),cD.$inject=["eventBus","modeling","bpmnRules","injector"],i(cj,rp),cj.prototype._replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;R(t,function(t){var r={type:t.newElementType},o=n.get(t.oldElementId),a=e.indexOf(o);e[a]=i.replaceElement(o,r,{select:!1})}),t&&r.select(e)},cj.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var cO={width:140,height:120},cN={width:300,height:60},cL={width:60,height:300},c$={width:300,height:150},cI={width:150,height:300},cF={width:140,height:120},cz={width:100,height:40};function cH(e){e.on("resize.start",1500,function(e){var t,n,i,r,o,a,s,c,l,p,u,h,d,f,m=e.context,g=m.shape,y=m.direction,v=m.balanced;(iu(g,"bpmn:Lane")||iu(g,"bpmn:Participant"))&&(t=g,n=y,i=v,r=sq(t),o=!0,a=!0,s=sW(r,[r]),c=tD(t),l={},p={},h=(u=iM(t))?cN:cL,/n/.test(n)?p.top=c.bottom-h.height:/e/.test(n)?p.right=c.left+h.width:/s/.test(n)?p.bottom=c.top+h.height:/w/.test(n)&&(p.left=c.right-h.width),s.forEac
354h(function(e){var t=tD(e);u?(t.top<c.top-10&&(o=!1),t.bottom>c.bottom+10&&(a=!1)):(t.left<c.left-10&&(o=!1),t.right>c.right+10&&(a=!1)),/n/.test(n)&&(i&&10>cV(c.top-t.bottom)&&cU(l,"top",t.top+h.height,cW),5>cV(c.top-t.top)&&cU(p,"top",t.bottom-h.height,cG)),/e/.test(n)&&(i&&10>cV(c.right-t.left)&&cU(l,"right",t.right-h.width,cG),5>cV(c.right-t.right)&&cU(p,"right",t.left+h.width,cW)),/s/.test(n)&&(i&&10>cV(c.bottom-t.top)&&cU(l,"bottom",t.bottom-h.height,cG),5>cV(c.bottom-t.bottom)&&cU(p,"bottom",t.top+h.height,cW)),/w/.test(n)&&(i&&10>cV(c.left-t.right)&&cU(l,"left",t.left+h.width,cW),5>cV(c.left-t.left)&&cU(p,"left",t.right-h.width,cG))}),d=r.children.filter(function(e){return!e.hidden&&!e.waypoints&&(iu(e,"bpmn:FlowElement")||iu(e,"bpmn:Artifact"))}),f=u?cq:cK,d.forEach(function(e){var t=tD(e);/n/.test(n)&&(!u||o)&&cU(p,"top",t.top-f.top,cG),/e/.test(n)&&(u||a)&&cU(p,"right",t.right+f.right,cW),/s/.test(n)&&(!u||a)&&cU(p,"bottom",t.bottom+f.bottom,cW),/w/.test(n)&&(u||o)&&cU(p,"left",t.left-f.left,cG)}),m.resizeConstraints={min:p,max:l}),iu(g,"bpmn:SubProcess")&&iA(g)&&(m.minDimensions=cF),iu(g,"bpmn:TextAnnotation")&&(m.minDimensions=cz)})}cH.$inject=["eventBus"];var cV=Math.abs,cG=Math.min,cW=Math.max;function cU(e,t,n,i){var r=e[t];e[t]=void 0===r?n:i(n,r)}var cq={top:20,left:50,right:20,bottom:20},cK={top:50,left:20,right:20,bottom:20};function cY(e,t){e.on("resize.start",1501,function(e){var t=e.context,n=t.shape;(iu(n,"bpmn:Lane")||iu(n,"bpmn:Participant"))&&(t.balanced=!rB(e))}),e.on("resize.end",1001,function(e){var n=e.context,i=n.shape,r=n.canExecute,o=n.newBounds;if(iu(i,"bpmn:Lane")||iu(i,"bpmn:Participant"))return r&&(o=tT(o),t.resizeLane(i,o,n.balanced)),!1})}function cX(e,t,n,i,r){function o(e){var t,n;return ih(e,["bpmn:ReceiveTask","bpmn:SendTask"])||(t=e,v(n=["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])||(n=[n]),M(n,function(e){return iB(t,e)}))}function a(t){return!!S(e.getDefinitions().get("rootElements"),L({id:t.id}))}function s(e){return iu(e,"bpmn:ErrorEventDefinition")?"errorRef":iu(e,"bpmn:EscalationEventDefinition")?"escalationRef":iu(e,"bpmn:MessageEventDefinition")?"messageRef":iu(e,"bpmn:SignalEventDefinition")?"signalRef":void 0}function c(e){if(ih(e,["bpmn:ReceiveTask","bpmn:SendTask"]))return e.get("messageRef");var t=e.get("eventDefinitions")[0];return t.get(s(t))}n.invoke(rp,this),this.executed(["shape.create","element.updateProperties","element.updateModdleProperties"],function(t){var n=t.shape||t.element;if(o(n)){var i=c(id(n));i&&!a(i)&&(e7(e.getDefinitions().get("rootElements"),i),t.addedRootElement=i)}},!0),this.reverted(["shape.create","element.updateProperties","element.updateModdleProperties"],function(t){var n=t.addedRootElement;n&&e8(e.getDefinitions().get("rootElements"),n)},!0),t.on("copyPaste.copyElement",function(e){var t=e.descriptor,n=e.element;if(!n.labelTarget&&o(n)){var i=c(id(n));i&&(t.referencedRootElement=i)}}),t.on("copyPaste.pasteElement",500,function(e){var t=e.descriptor,n=t.businessObject,o=t.referencedRootElement;o&&(a(o)||(o=i.copyElement(o,r.create(o.$type))),function(e,t){if(ih(e,["bpmn:ReceiveTask","bpmn:SendTask"]))return e.set("messageRef",t);var n=e.get("eventDefinitions")[0];n.set(s(n),t)}(n,o),delete t.referencedRootElement)})}cY.$inject=["eventBus","modeling"],cX.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],i(cX,rp);var cZ=Math.max;function cJ(e){e.on("spaceTool.getMinDimensions",function(e){var t=e.shapes,n=e.axis,i=e.start,r={};return R(t,function(e){var t=e.id;iu(e,"bpmn:Participant")&&(r[t]=function(e,t,n){var i,r,o,a,s,c,l,p,u,h,d,f,m,g,y,v,b=iM(e);if(!sU(e).length)return b?c$:cI;var _="x"===t;return _?b?c$:{width:(i=e,r=n,o=_,s=i,c=r,l=o,p=cQ(sU(s),c,l),a=s.width-p.width+cL.width,cZ(cI.width,a)),height:cI.height}:b?{width:c$.width,height:(u=e,h=n,d=_,m=u,g=h,y=d,v=cQ(sU(m),g,y),f=m.height-v.height+cN.height,cZ(c$.height,f))}:cI}(e,n,i)),iu(e,"bpmn:Lane")&&(r[t]=iM(e)?cN:cL),iu(e,"bpmn:SubProcess")&&iA(e)&&(r[t]=cF),iu(e,"bpmn:TextAnnotation")&&(r[t]=cz),iu(e,"bpm
354n:Group")&&(r[t]=cO)}),r})}function cQ(e,t,n){var i,r,o;for(i=0;i<e.length;i++)if(r=e[i],!n&&t>=r.y&&t<=r.y+r.height||n&&t>=r.x&&t<=r.x+r.width){if((o=sU(r)).length)return cQ(o,t,n);return r}}cJ.$inject=["eventBus"];function c0(e,t,n,i,r,o,a){rp.call(this,t),this._canvas=e,this._eventBus=t,this._modeling=n,this._elementFactory=i,this._bpmnFactory=r,this._bpmnjs=o,this._elementRegistry=a;var s=this;function c(e){return iu(e,"bpmn:SubProcess")&&!iA(e)}function l(t){var n=t.shape,i=t.newRootElement,r=id(n);i=s._addDiagram(i||r),t.newRootElement=e.addRootElement(i)}function p(t){var n=id(t.shape);s._removeDiagram(n);var i=t.newRootElement=a.get(ry(n));e.removeRootElement(i)}this.executed("shape.create",function(e){c(e.shape)&&l(e)},!0),this.postExecuted("elements.create",function(e){R(e.elements,function(e){if(c(e)){var t=a.get(ry(e));if(t&&e.children&&e.children.length){var n=c1(e);s._showRecursively(n),s._moveChildrenToShape(n,t)}}})},!0),this.reverted("shape.create",function(e){c(e.shape)&&p(e)},!0),this.preExecute("shape.delete",function(e){var t=e.shape;iu(t,"bpmn:SubProcess")&&iA(t)&&R(iF([t]),e=>{n.removeShape(e.annotation)})},!0),this.preExecuted("shape.delete",function(e){var t=e.shape;if(c(t)){var i=a.get(ry(t));i&&n.removeElements(i.children.slice())}},!0),this.executed("shape.delete",function(e){c(e.shape)&&p(e)},!0),this.reverted("shape.delete",function(e){c(e.shape)&&l(e)},!0),this.preExecuted("shape.replace",function(t){var n=t.oldShape,i=t.newShape;c(n)&&c(i)&&(t.oldRoot=e.removeRootElement(ry(n)))},!0),this.postExecuted("shape.replace",function(t){var i=t.newShape,r=t.oldRoot,o=e.findRoot(ry(i));if(r&&o){var a=r.children;n.moveElements(a,{x:0,y:0},o)}},!0),this.executed("element.updateProperties",function(e){var t=e.element;if(iu(t,"bpmn:SubProcess")){var n=e.properties,i=e.oldProperties.id,r=n.id;if(i!==r){if(rv(t)){a.updateId(t,r+rg),a.updateId(i,r);return}a.get(i+rg)&&a.updateId(i+rg,r+rg)}}},!0),this.reverted("element.updateProperties",function(e){var t=e.element;if(iu(t,"bpmn:SubProcess")){var n=e.properties,i=e.oldProperties.id,r=n.id;if(i!==r){if(rv(t)){a.updateId(t,i+rg),a.updateId(r,i);return}var o=a.get(r+rg);o&&a.updateId(o,i+rg)}}},!0),t.on("element.changed",function(e){var n=e.element;if(rv(n)){var i=a.get(rb(n.id));i&&i!==n&&t.fire("element.changed",{element:i})}}),this.executed("shape.toggleCollapse",400,function(e){var t=e.shape;iu(t,"bpmn:SubProcess")&&(iA(t)?p(e):(l(e),s._showRecursively(t.children)))},!0),this.reverted("shape.toggleCollapse",400,function(e){var t=e.shape;iu(t,"bpmn:SubProcess")&&(iA(t)?p(e):(l(e),s._showRecursively(t.children)))},!0),this.postExecuted("shape.toggleCollapse",600,function(e){var t=e.shape;if(iu(t,"bpmn:SubProcess")){var i=e.newRootElement;if(i)if(iA(t))s._moveChildrenToShape(i.children.slice(),t),R(iF(t.children),e=>{n.moveShape(e.annotation,{x:0,y:0},t.parent),R(e.associations,e=>{n.moveConnection(e,{x:0,y:0},t.parent)})});else{s._disconnectSharedAnnotations(t);var r=c1(t);s._moveChildrenToShape(r,i)}}},!0),t.on("copyPaste.createTree",function(e){var t=e.element,n=e.children;if(c(t)){var i=ry(t),r=a.get(i);r&&n.push.apply(n,r.children)}}),t.on("copyPaste.copyElement",function(e){var t=e.descriptor,n=e.element,i=e.elements,r=n.parent;if(iu(im(r),"bpmndi:BPMNPlane")){var o=rb(r.id),a=S(i,function(e){return e.id===o});a&&(t.parent=a.id)}}),t.on("copyPaste.pasteElement",function(e){var t=e.descriptor;t.parent&&(c(t.parent)||t.parent.hidden)&&(t.hidden=!0)})}function c1(e){var t,n,i;return e.children.slice().concat((t=e.children,n=[],R(iF(t),e=>{n.push(e.annotation),n.push.apply(n,e.associations)}),n)).concat(e0((i=e).children||[],!0,-1).reduce(function(e,t){return t.label&&t.label.parent!==i&&e.push(t.label),e},[]))}function c2(e,t){e.invoke(rp,this),this.postExecuted("shape.replace",function(e){var n=e.context.oldShape,i=e.context.newShape;if(!(!iu(i,"bpmn:SubProcess")||iu(i,"bpmn:AdHocSubProcess"))&&(iu(n,"bpmn:Task")||iu(n,"bpmn:CallActivity"))&&iA(i)){var r,o={x:(r=i).x+r.width/6,y:r.y+r.height/2};t.createShape({type:"bpmn:StartEvent"},o,i)}})}
354function c5(e,t){rp.call(this,e),this.preExecute("connection.create",function(e){let{target:t}=e;iu(t,"bpmn:TextAnnotation")&&(e.parent=t.parent)},!0),this.preExecute(["shape.create","shape.resize","elements.move"],function(e){let t=e.shapes||[e.shape];1===t.length&&iu(t[0],"bpmn:TextAnnotation")&&(e.hints=e.hints||{},e.hints.autoResize=!1)},!0),this.preExecute("shape.resize",function(e){var n=e.context,i=n.shape,r=n.hints||{};if(iu(i,"bpmn:TextAnnotation")&&!r.autoResize){var o=n.newBounds,a=t.getTextAnnotationBounds(o,i$(i)||""),s=o.y!==i.y&&1>=Math.abs(o.y+o.height-(i.y+i.height)),c=i.y+i.height;n.newBounds={width:o.width,height:a.height,x:o.x,y:s?c-a.height:o.y}}})}function c3(e,t){rp.call(this,e),this.postExecuted("shape.toggleCollapse",1500,function(e){var n=e.shape;if(!iA(n)){var i=e1(n);i.forEach(function(e){var t=e.incoming.slice(),n=e.outgoing.slice();R(t,function(e){r(e,!0)}),R(n,function(e){r(e,!1)})})}function r(e,r){-1!==i.indexOf(e.source)&&-1!==i.indexOf(e.target)||iu(e,"bpmn:Association")&&(iu(e.source,"bpmn:TextAnnotation")||iu(e.target,"bpmn:TextAnnotation"))||(r?t.reconnectEnd(e,n,tO(n)):t.reconnectStart(e,n,tO(n)))}},!0)}function c6(e,t,n){rp.call(this,e),this.executed(["shape.toggleCollapse"],500,function(e){var t,n=e.context.shape;iu(n,"bpmn:SubProcess")&&(n.collapsed?im(n).isExpanded=!1:((t=n.children).length&&t.forEach(function(e){"label"!==e.type||e.businessObject.name||(e.hidden=!0)}),im(n).isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],500,function(e){var t=e.context.shape;t.collapsed?im(t).isExpanded=!1:im(t).isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],500,function(e){var i,r,o=e.context.shape,a=t.getDefaultSize(o);if(o.collapsed)r={x:o.x+(o.width-a.width)/2,y:o.y+(o.height-a.height)/2,width:a.width,height:a.height};else(i=sH(o.children.filter(function(e){return!e.hidden}).concat([o])))?(a.width=Math.max(i.width,a.width),a.height=Math.max(i.height,a.height),a.x=i.x+(i.width-a.width)/2,a.y=i.y+(i.height-a.height)/2):(a.x=o.x+(o.width-a.width)/2,a.y=o.y+(o.height-a.height)/2),r=a;n.resizeShape(o,r,null,{autoResize:!o.collapsed&&"nwse"})})}function c9(e,t,n,i){t.invoke(rp,this),this.preExecute("shape.delete",function(e){var t=e.context.shape,r=t.businessObject;tM(t)||(iu(t,"bpmn:Participant")&&iA(t)&&n.ids.unclaim(r.processRef.id),i.unclaimId(r.id,r))}
354),this.preExecute("connection.delete",function(e){var t=e.context.connection.businessObject;i.unclaimId(t.id,t)}),this.preExecute("canvas.updateRoot",function(){var t=e.getRootElement(),i=t.businessObject;iu(t,"bpmn:Collaboration")&&n.ids.unclaim(i.id)})}function c4(e,t){rp.call(this,e),this.preExecute("connection.delete",function(e){var n=e.context.connection,i=n.source;(function(e,t){if(!iu(e,"bpmn:SequenceFlow"))return!1;var n=id(t),i=id(e);return n.get("default")===i})(n,i)&&t.updateProperties(i,{default:null})})}i(c0,rp),c0.prototype._moveChildrenToShape=function(e,t){var n,i=this._modeling;if(e.length){var r=e.filter(function(e){return!e.hidden});if(!r.length)return void i.moveElements(e,{x:0,y:0},t,{autoResize:!1});var o=e2(r);if(t.x){var a=tO(t),s=tO(o);n={x:a.x-s.x,y:a.y-s.y}}else n={x:180-o.x,y:160-o.y};i.moveElements(e,n,t,{autoResize:!1})}},c0.prototype._disconnectSharedAnnotations=function(e){var t=this._modeling,n=new Set(iI(e).map(e=>e.annotation));n.size&&R(iF(e.children),e=>{n.has(e.annotation)&&R(e.associations,e=>{t.removeConnection(e)})})},c0.prototype._showRecursively=function(e,t){var n=this,i=[];return e.forEach(function(e){e.hidden=!!t,i=i.concat(e),e.children&&(i=i.concat(n._showRecursively(e.children,e.collapsed||t)))}),i},c0.prototype._addDiagram=function(e){var t=this._bpmnjs.getDefinitions().diagrams;return e.businessObject||(e=this._createNewDiagram(e)),t.push(e.di.$parent),e},c0.prototype._createNewDiagram=function(e){var t=this._bpmnFactory,n=this._elementFactory,i=t.create("bpmndi:BPMNPlane",{bpmnElement:e}),r=t.create("bpmndi:BPMNDiagram",{plane:i});return i.$parent=r,n.createRoot({id:ry(e),type:e.$type,di:i,businessObject:e,collapsed:!0})},c0.prototype._removeDiagram=function(e){var t=this._bpmnjs.getDefinitions().diagrams,n=S(t,function(t){return t.plane.bpmnElement.id===e.id});return t.splice(t.indexOf(n),1),n},c0.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"],c2.$inject=["injector","modeling"],i(c2,rp),i(c5,rp),c5.$inject=["eventBus","textRenderer"],i(c3,rp),c3.$inject=["eventBus","modeling"],i(c6,rp),c6.$inject=["eventBus","elementFactory","modeling"],i(c9,rp),c9.$inject=["canvas","injector","moddle","modeling"],i(c4,rp),c4.$inject=["eventBus","modeling"];var c8=["shape.create","shape.delete","shape.move","shape.resize"],c7=[...c8,"spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move"];function le(e,t){var n;rp.call(this,e),this.preExecute(c7,5e3,function(){(n=n||new lt).enter()}),this.postExecuted(c7,500,function(){if(!n)throw Error("out of bounds release");n.leave()&&(t.updateLaneRefs(n.flowNodes,n.lanes),n=null)}
354),this.preExecute(c8,function(e){var t=e.context.shape,i=function(){if(!n)throw Error("out of bounds release");return n}();t&&!t.labelTarget&&(iu(t,"bpmn:Lane")&&i.addLane(t),iu(t,"bpmn:FlowNode")&&i.addFlowNode(t))})}function lt(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}le.$inject=["eventBus","modeling"],i(le,rp);var ln=["connection.create","connection.delete","connection.layout","connection.move","connection.reconnect","connection.updateWaypoints","shape.create","shape.delete","shape.move","shape.resize"],li=[...ln,"elements.create","elements.delete","elements.move","label.create","spaceTool"];function lr(e,t){var n;function i(){if(!n)throw Error("out of bounds release");return n}rp.call(this,e),this.preExecute(li,5e3,function(){(n=n||new lo).enter()}),this.postExecuted(li,500,function(){if(!n)throw Error("out of bounds release");n.leave()&&(t.updateCategoryValueRefs(Array.from(n.affectedFlowElements),Array.from(n.affectedGroupEntries.values())),n=null)}
354),this.preExecute(ln,function(e){var t=e.context.connection||e.context.shape,n=i();t&&!t.labelTarget&&(iu(t,"bpmn:FlowElement")&&n.addFlowElement(t),iu(t,"bpmn:Group")&&n.addGroup(t))}),this.preExecute("label.create",function(e){var t=e.context.labelTarget;iu(t,"bpmn:Group")&&i().addGroup(t)})}function lo(){this.affectedFlowElements=new Set,this.affectedGroupEntries=new Map,this.counter=0,this.addFlowElement=function(e){this.affectedFlowElements.add(e)},this.addGroup=function(e){this.affectedGroupEntries.has(e)||this.affectedGroupEntries.set(e,{categoryValue:e.businessObject.categoryValueRef,groupShape:e})},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function la(e,t){rp.call(this,e),this.postExecuted("elements.create",function(e){for(let n of e.context.elements)(function(e){let t=id(e);return t&&t.isForCompensation})(n)&&!(n.incoming.filter(e=>{var t;return(t=e.source)&&iu(t,"bpmn:BoundaryEvent")&&iB(t,"bpmn:CompensateEventDefinition")}).length>0)&&t.updateProperties(n,{isForCompensation:void 0})})}function ls(e,t){var n=tN(e,t,-15);return"intersect"!==n?n:null}function lc(e){o1.call(this,e)}lr.$inject=["eventBus","modeling"],i(lr,rp),i(la,rp),la.$inject=["eventBus","modeling"],i(lc,o1),lc.$inject=["eventBus"],lc.prototype.init=function(){this.addRule("connection.start",function(e){var t;return function(e){return!e||tM(e)}(t=e.source)?null:ih(t,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}),this.addRule("connection.create",function(e){var t=e.source,n=e.target,i=e.hints||{},r=i.targetParent;if(i.targetAttach)return!1;r&&(n.parent=r);try{return lv(t,n)}finally{r&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection;return lv(e.source,e.target,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){return lA(e.shape,e.newBounds,e.direction)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,i=e.target;return(!tA(i)||!!lO(t,i,n))&&A(t,function(e){return tA(e)?lv(e.source,e.target,e):e.host?lk(e,e.host,null,n):lP(e,i,null,n)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,i=e.position,r=e.hints;return!(null!=r&&r.keyboardMove&&n.some(function(e){return l_(e)&&!n.includes(e.host)}))&&(lk(n,t,null,i)||lC(n,t,i)||lR(n,t)||lO(n,t,i))}),this.addRule("shape.create",function(e){return lP(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return lk(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element;return lL(e.elements,t)})},lc.prototype.canConnectMessageFlow=lB,lc.prototype.canConnectSequenceFlow=lD,lc.prototype.canConnectDataAssociation=lj,lc.prototype.canConnectAssociation=lM,lc.prototype.canConnectCompensationAssociation=lT,lc.prototype.canMove=lR,lc.prototype.canAttach=lk,lc.prototype.canReplace=lC,lc.prototype.canDrop=lb,lc.prototype.canInsert=lO,lc.prototype.canCreate=lP,lc.prototype.canConnect=lv,lc.prototype.canResize=lA,lc.prototype.canCopy=lL;function ll(e){do{if(iu(e,"bpmn:Process"))return id(e);if(iu(e,"bpmn:Participant"))return id(e).processRef||id(e)}while(e=e.parent)}function lp(e){return iu(e,"bpmn:TextAnnotation")}function lu(e){return iu(e,"bpmn:Group")&&!e.labelTarget}function lh(e){return iu(e,"bpmn:BoundaryEvent")&&lm(e,"bpmn:CompensateEventDefinition")}function ld(e){return id(e).isForCompensation}function lf(e){for(var t=e;t=t.parent;){if(iu(t,"bpmn:FlowElementsContainer"))return id(t);if(iu(t,"bpmn:Participant"))return id(t).processRef}return null}function lm(e,t){return!!S(id(e).eventDefinitions||[],function(e){return iu(e,t)})}function lg(e,t){return(id(e).eventDefinitions||[]).every(function(e){return iu(e,t)})}function ly(e,t){return -1!==(function(e){for(var t=[];e;)(e=e.parent)&&t.push(e);return t})(t).indexOf(e)}function lv(e,t,n){if(!e||tM(e)||!(i=t)||tM(i))return null;if(!iu(n,"bpmn:DataAssociation")){if(lB(e,t))return{type:"bpmn:MessageFlow"};
354if(lD(e,t))return{type:"bpmn:SequenceFlow"}}var i,r=lj(e,t);return r||(lT(e,t)?{type:"bpmn:Association",associationDirection:"One"}:!!lM(e,t)&&{type:"bpmn:Association",associationDirection:"None"})}function lb(e,t){var n;if(tM(e)||lu(e))return!0;if(iu(t,"bpmn:Participant")&&!iA(t))return!1;if(iu(e,"bpmn:Participant"))return iu(t,"bpmn:Process")||iu(t,"bpmn:Collaboration");if(ih(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent)return t===e.parent;if(iu(e,"bpmn:Lane"))return iu(t,"bpmn:Participant")||iu(t,"bpmn:Lane");return(!iu(e,"bpmn:BoundaryEvent")||!!(id(n=e).cancelActivity&&(lw(n)||lE(n))))&&(iu(e,"bpmn:FlowElement")&&!iu(e,"bpmn:DataStoreReference")?iu(t,"bpmn:FlowElementsContainer")?iA(t):ih(t,["bpmn:Participant","bpmn:Lane"]):iu(e,"bpmn:DataStoreReference")&&iu(t,"bpmn:Collaboration")?M(id(t).get("participants"),function(e){return!!e.get("processRef")}):ih(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?ih(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!iu(e,"bpmn:MessageFlow")&&(iu(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t))}function l_(e){return!tM(e)&&iu(e,"bpmn:BoundaryEvent")}function lx(e){return iu(e,"bpmn:Lane")}function lw(e){var t=id(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function lE(e){return lS(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function lS(e,t){return t.some(function(t){return lm(e,t)})}function lk(e,t,n,i){if(Array.isArray(e)||(e=[e]),1!==e.length)return!1;var r=e[0];return!(tM(r)||!(l_(r)||iu(r,"bpmn:IntermediateThrowEvent")&&lw(r)||iu(r,"bpmn:IntermediateCatchEvent")&&lE(r))||iT(t)||!iu(t,"bpmn:Activity")||ld(t)||i&&!ls(i,t))&&!(iu(t,"bpmn:ReceiveTask")&&S(t.incoming,function(e){return iu(e.source,"bpmn:EventBasedGateway")}))&&"attach"}function lC(e,t,n){if(!t)return!1;var i={replacements:[]};return R(e,function(e){!iT(t)&&iu(e,"bpmn:StartEvent")&&"label"!==e.type&&lb(e,t)&&(e&&!1!==id(e).isInterrupting||i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),(iB(e,"bpmn:ErrorEventDefinition")||iB(e,"bpmn:EscalationEventDefinition")||iB(e,"bpmn:CompensateEventDefinition"))&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),lS(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&iu(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}));!iu(t,"bpmn:Transaction")&&lm(e,"bpmn:CancelEventDefinition")&&"label"!==e.type&&(iu(e,"bpmn:EndEvent")&&lb(e,t)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:EndEvent"}),iu(e,"bpmn:BoundaryEvent")&&lk(e,t,null,n)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:BoundaryEvent"}))}),!!i.replacements.length&&i}function lR(e,t){return!M(e,lx)&&(void 0===t||null!==t&&e.every(function(e){return lb(e,t)}))}function lP(e,t,n,i){return!!t&&(!!(tM(e)||lu(e))||lb(e,t)||lO(e,t,i))}function lA(e,t,n){return iu(e,"bpmn:SubProcess")?iA(e)&&(!t||t.width>=100&&t.height>=80):!!(iu(e,"bpmn:Lane")||iu(e,"bpmn:Participant"))||(lp(e)?!n||"e"===n||"w"===n:!!lu(e)||!!tM(e)&&(!n||"e"===n||"w"===n))}function lM(e,t){var n,i;return!(ly(t,e)||ly(e,t))&&(n=lp(e),i=lp(t),(!!n||!!i)&&n!==i||!!lj(e,t))}function lT(e,t){var n,i;return lf(e)===lf(t)&&lh(e)&&iu(t,"bpmn:Activity")&&(n=t,i=e,!n.attachers.includes(i))&&!iT(t)}function lB(e,t){var n;
354return(!lI(e)||!!lI(t))&&iu(e,"bpmn:InteractionNode")&&!iu(e,"bpmn:BoundaryEvent")&&(!iu(e,"bpmn:Event")||iu(e,"bpmn:ThrowEvent")&&lg(e,"bpmn:MessageEventDefinition"))&&iu(n=t,"bpmn:InteractionNode")&&!ld(n)&&(!iu(n,"bpmn:Event")||iu(n,"bpmn:CatchEvent")&&lg(n,"bpmn:MessageEventDefinition"))&&!(iu(n,"bpmn:BoundaryEvent")&&!lm(n,"bpmn:MessageEventDefinition"))&&ll(e)!==ll(t)}function lD(e,t){var n;return iu(e,"bpmn:FlowNode")&&!iu(e,"bpmn:EndEvent")&&!iT(e)&&!(iu(e,"bpmn:IntermediateThrowEvent")&&lm(e,"bpmn:LinkEventDefinition"))&&!lh(e)&&!ld(e)&&iu(n=t,"bpmn:FlowNode")&&!iu(n,"bpmn:StartEvent")&&!iu(n,"bpmn:BoundaryEvent")&&!iT(n)&&!(iu(n,"bpmn:IntermediateCatchEvent")&&lm(n,"bpmn:LinkEventDefinition"))&&!ld(n)&&lf(e)===lf(t)&&!(iu(e,"bpmn:EventBasedGateway")&&!(iu(t,"bpmn:ReceiveTask")||iu(t,"bpmn:IntermediateCatchEvent")&&(lm(t,"bpmn:MessageEventDefinition")||lm(t,"bpmn:TimerEventDefinition")||lm(t,"bpmn:ConditionalEventDefinition")||lm(t,"bpmn:SignalEventDefinition"))))}function lj(e,t){return ih(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&ih(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!!(ih(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&ih(e,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function lO(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(1!==e.length)return!1;e=e[0]}return t.source!==e&&t.target!==e&&ih(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!tM(t)&&iu(e,"bpmn:FlowNode")&&!iu(e,"bpmn:BoundaryEvent")&&lb(e,t.parent)}function lN(e,t){return e&&t&&-1!==e.indexOf(t)}function lL(e,t){var n,i,r,o;return!!tM(t)||!(iu(t,"bpmn:Lane")&&!lN(e,t.parent)||iu(t,"bpmn:MessageFlow")&&(n=e,r=l$((i=t).source),o=l$(i.target),!(lN(n,r)&&lN(n,o))))}function l$(e){for(;e;e=e.parent)if(iu(e,"bpmn:Participant"))return e;return null}function lI(e){return o7(e,"bpmn:Process")||o7(e,"bpmn:Collaboration")}function lF(e,t){e.on("saveXML.start",2e3,function(){R(t.getRootElements(),function(e){var t,n=im(e);t=T(C(e1([e],!1),function(t){return t!==e&&!t.labelTarget}),im),n.set("planeElement",t)})})}function lz(e){rp.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],function(e){var n=e.context,i=n.shape||n.connection,r=n.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.parent=o.parent),n.parentIndex=o.index)}
vendor: 4,566 bytes, line 354
354),this.preExecute(["shape.move","connection.move"],function(e){var n=e.context,i=n.shape||n.connection,r=n.newParent||i.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.newParent=o.parent),n.newParentIndex=o.index)})}function lH(e,t){lz.call(this,e);var n=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:9,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:TextAnnotation",order:{level:9}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function i(e){var t=e.order;if(t||(e.order=t=function(e){if(e.labelTarget)return{level:10};var t=S(n,function(t){return ih(e,[t.type])});return t&&t.order||{level:1}}(e)),!t)throw Error(`no order for <${e.id}>`);return t}this.getOrdering=function(e,n){if(e.labelTarget||iu(e,"bpmn:TextAnnotation"))return{parent:t.findRoot(n)||t.getRootElement(),index:-1};var r=i(e);r.containers&&(n=function(e,t,n){for(var i=t;i&&!ih(i,n);)i=i.parent;if(!i)throw Error(`no parent for <${e.id}> in <${t&&t.id}>`);return i}(e,n,r.containers));var o=n.children.indexOf(e),a=k(n.children,function(t){return(!!e.labelTarget||!t.labelTarget)&&r.level<i(t).level});return -1!==a&&-1!==o&&o<a&&(a-=1),{index:a,parent:n}}}function lV(){}lF.$inject=["eventBus","canvas"],lz.prototype.getOrdering=function(e,t){return null},i(lz,rp),lH.$inject=["eventBus","canvas"],i(lH,lz),lV.prototype.get=function(){return this._data},lV.prototype.set=function(e){this._data=e},lV.prototype.clear=function(){var e=this._data;return delete this._data,e},lV.prototype.isEmpty=function(){return!this._data};var lG="drop-not-ok",lW="attach-ok",lU="new-parent",lq="create";function lK(e,t,n,i,r){function o(t,n){[lW,"drop-ok",lG,lU].forEach(function(i){i===n?e.addMarker(t,i):e.removeMarker(t,i)})}function a(){var e=t.context();e&&e.prefix===lq&&t.cancel()}n.on(["create.move","create.hover"],function(e){var t=e.context,n=t.elements,i=e.hover,a=t.source,s=t.hints||{};if(!i){t.canExecute=!1,t.target=null;return}lY(e);var c={x:e.x,y:e.y},l=t.canExecute=i&&function(e,t,n,i,o){if(!t)return!1;var a=S(e=C(e,function(t){var n=t.labelTarget;return!t.parent&&!(tM(t)&&-1!==e.indexOf(n))}),function(e){return!tA(e)}),s=!1,c=!1,l=!1;lX(e)&&(s=r.allowed("shape.attach",{position:n,shape:a,target:t})),s||(l=lX(e)?r.allowed("shape.create",{position:n,shape:a,source:i,target:t}):r.allowed("elements.create",{elements:e,position:n,target:t}));var p=o.connectionTarget;return l||s?(a&&i&&(c=r.allowed("connection.create",{source:p===i?a:i,target:p===i?i:a,hints:{targetParent:t,targetAttach:s}})),{attach:s,connect:c}):(null===l||null===s)&&null}(n,i,c,a,s);i&&null!==l&&(t.target=i,l&&l.attach?o(i,lW):o(i,l?lU:lG))}),n.on(["create.end","create.out","create.cleanup"],function(e){var t=e.hover;t&&o(t,null)}),n.on("create.end",function(e){var t=e.context,n=t.source,r=t.shape,o=t.elements,a=t.target,s=t.canExecute,c=s&&s.attach,l=s&&s.connect,p=t.hints||{};if(!1===s||!a)return!1;lY(e);var u={x:e.x,y:e.y};r=l?i.appendShape(n,r,u,a,{attach:c,connection:!0===l?{}:l,connectionTarget:p.connectionTarget}):S(o=i.createElements(o,u,a,G({},p,{attach:c})),function(e){return!tA(e)}),G(t,{elements:o,shape:r}),G(e,{elements:o,shape:r})}),n.on("create.init",function(){n.on("elements.changed",a),n.once(["create.cancel","create.end"],2e3,function(){n.off("elements.changed",a)})}),this.start=function(e,n,i){v(n)||(n=[n]);var r=S(n,function(e){return!tA(e)});if(r){i=G({elements:n,hints:{},shape:r},i||{}),R(n,function(e){_(e.x)||(e.x=0),_(e.y)||(e.y=0)});var o=e2(C(n,function(e){return!e.hidden}));R(n,function(e){tA(e)&&(e.waypoints=T(e.waypoints,function(e){return{x:e.x-o.x-o.width/2,y:e.y-o.y-o.height/2}})),G(e,{x:e.x-o.x-o.width/2,y:e.y-o.y-o.height/2})}),t.init(e,lq,{cursor:"grabbing",autoActivate:!0,data:{shape:r,elements:n,context:i}})}}}function lY(e){var t=e.context.createConstraints;t&&(t.left&&(e.x=Math.max(e.x,t.left)),t.right&&(e.x=Math.min(e.x,t.right)),t.top&&(e.y=Math.max(e.y,t.top)),t.bottom&&(e.y=Math.min(e.y,t.bottom)))}function lX(e){return e&&1===e.length&&!tA(e[0])}
354function lZ(e,t,n,i,r){t.on("create.move",750,function(t){var o,a,s=t.hover,c=t.context,l=c.elements,p=c.dragGroup;p||(eg(o=ek("g"),r.cls("djs-drag-group",["no-events"])),a=ek("g"),l.forEach(function(e){var t;e.hidden||(e.waypoints?(t=n._createContainer("connection",a),n.drawConnection(ne(t),e)):(t=n._createContainer("shape",a),n.drawShape(ne(t),e),nn(t,e.x,e.y)),i.addDragger(e,o,t))}),p=c.dragGroup=o),s?(p.parentNode||ed(e.getActiveLayer(),p),nn(p,t.x,t.y)):eO(p)}),t.on("create.cleanup",function(e){var t=e.context.dragGroup;t&&eO(t)})}lK.$inject=["canvas","dragging","eventBus","modeling","rules"],lZ.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];let lJ={__depends__:[af,sl,ay,rG],__init__:["create","createPreview"],create:["type",lK],createPreview:["type",lZ]};function lQ(e){var t=this;function n(e){t._lastMoveEvent=e}this._lastMoveEvent=null,e.on("canvas.init",function(e){(t._svg=e.svg).addEventListener("mousemove",n)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)})}lQ.$inject=["eventBus"],lQ.prototype.getLastMoveEvent=function(){var e;return this._lastMoveEvent||((e=document.createEvent("MouseEvent")).initMouseEvent&&e.initMouseEvent("mousemove",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e)};let l0={__init__:["mouse"],mouse:["type",lQ]};function l1(e,t,n,i,r,o,a,s){this._canvas=e,this._create=t,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=a,this._rules=s,r.on("copyPaste.copyElement",function(e){var t=e.descriptor,n=e.element,i=e.elementsSet;t.priority=1,t.id=n.id,i.has(n.parent)&&(t.parent=n.parent.id),n.host&&(t.priority=2,t.host=n.host.id),tA(n)&&(t.priority=3,t.source=n.source.id,t.target=n.target.id,t.waypoints=T(n.waypoints,function(e){return(e=function(e){return G({},e)}(e)).original&&(e.original=function(e){return G({},e)}(e.original)),e})),tM(n)&&(t.priority=4,t.labelTarget=n.labelTarget.id),R(["x","y","width","height"],function(e){_(n[e])&&(t[e]=n[e])}),t.hidden=n.hidden,t.collapsed=n.collapsed}),r.on("copyPaste.elementsCopied",2e3,function(e){var t;(null==(t=e.hints)?void 0:t.clip)!==!1&&n.set(e.tree)}),r.on("copyPaste.pasteElements",2e3,function(e){e.tree||(e.tree=n.get())}),r.on("copyPaste.pasteElements",function(e){G(e.hints,{createElementsBehavior:!1})})}function l2(e,t){var n=t.indexOf(e);return -1===n?t:t.splice(n,1)}function l5(e,t,n){v(n)||(n=[n]),R(n,function(n){m(e[n])||(t[n]=e[n])})}function l3(e,t,n){function i(t,i){var r=e.create(t.$type);return n.copyElement(t,r,null,i)}t.on("copyPaste.copyElement",750,function(e){var t=e.descriptor,n=e.element,r=id(n);if(tM(n))return t;var o=t.businessObject=i(r,!0),a=t.di=i(im(n),!0);a.bpmnElement=o,l5(o,t,"name"),l5(a,t,"isExpanded"),r.default&&(t.default=r.default.id)});var r="-bpmn-js-refs";t.on("copyPaste.pasteElement",function(e){var t=e.cache,n=e.descriptor,r=n.businessObject,o=n.di;if(tM(n)){n.businessObject=id(t[n.labelTarget]),n.di=im(t[n.labelTarget]);return}r=n.businessObject=i(r),(o=n.di=i(o)).bpmnElement=r,l5(n,r,["isExpanded","name"]),n.type=r.$type}),t.on("copyPaste.copyElement",750,function(e){var t=e.descriptor,n=e.element;if(iu(n,"bpmn:Participant")){var r=id(n);r.processRef&&(t.processRef=i(r.processRef,!0))}}),t.on("copyPaste.pasteElement",function(e){var t=e.descriptor,n=t.processRef;n&&(t.processRef=i(n))}),t.on("copyPaste.createTree",function(e){var t=e.element,n=e.children;iu(t,"bpmn:SubProcess")&&R(iF(n),e=>{n.push(e.annotation)})}),t.on("copyPaste.pasteElement",750,function(e){var t,n,i,o=e.cache,a=e.descriptor;t=o[r]=o[r]||{},n=id(a),a.default&&(t[a.default]={element:n,property:"default"}),a.host&&(id(a).attachedToRef=id(o[a.host])),i=U(t,P(t,function(e,t,i){var r=t.element,o=t.property;return i===a.id&&(r.set(o,n),e.push(a.id)),e},[])),o[r]=i})}l1.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],l1.prototype.copy=function(e,t={}){var n,i;return v(e)||(e=e?[e]:[]),i=!1===(n=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}))?{}:this.createTree(v(n)?n:e),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:i,hints:t}),i},l1.prototype.paste=function(e={}){var t=this._eventBus.createEvent({type:"copyPaste.pasteElements",hints:{},...e});if(!1!==this._eventBus.fire(t)){var n=t.tree;if(n){var i=t.hints,r=this._createElements(n);if(t.element&&t.point)return this._paste(r,t.element,t.point,i);this._create.start(this._mouse.getLastMoveEvent(),r,{hints:i})}}},l1.prototype.duplicate=function(e,t={}){var n=this.copy(e,{clip:!1});return this.paste({...t,tree:n})},l1.prototype.cut=function(e){var t=this.copy(e),n=this._getElementIdsFromTree(t),i=e.filter(function(e){return n[e.id]});return i.length>0&&this._modeling.removeElements(i),t},l1.prototype._getElementIdsFromTree=function(e){var t={};return R(e,function(e){R(e,function(e){e.id&&(t[e.id]=!0)})}),t},l1.prototype._paste=function(e,t,n,i){R(e,function(e){_(e.x)||(e.x=0),_(e.y)||(e.y=0)});var r=e2(e);return R(e,function(e){tA(e)&&(e.waypoints=T(e.waypoints,function(e){return{x:e.x-r.x-r.width/2,y:e.y-r.y-r.height/2}})),G(e,{x:e.x-r.x-r.width/2,y:e.y-r.y-r.height/2})}),this._modeling.createElements(e,n,t,G({},i))},l1.prototype._createElements=function(e){var t=this,n=this._eventBus,i={},r=[];return R(e,function(e,o){o=parseInt(o,10),R(e=N(e,"priority"),function(e){var o,a=G({},U(e,["priority"]));if(i[e.parent]?a.parent=i[e.parent]:delete a.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:a}),tA(a)){a.source=i[e.source],a.target=i[e.target],o=i[e.id]=t.createConnection(a),r.push(o);return}if(tM(a)){a.labelTarget=i[a.labelTarget],o=i[e.id]=t.createLabel(a),r.push(o);return}a.host&&(a.host=i[a.host]),o=i[e.id]=t.createShape(a),r.push(o)})}),r},l1.prototype.createConnection=function(e){return this._elementFactory.createConnection(U(e,["id"]))},l1.prototype.createLabel=function(e){return this._elementFactory.createLabel(U(e,["id"]))},l1.prototype.createShape=function(e){return this._elementFactory.createShape(U(e,["id"]))},l1.prototype.hasRelations=function(e,t,n){return n||(n=new Set(t)),!(tA(e)&&(!n.has(e.source)||!n.has(e.target))||tM(e)&&!n.has(e.labelTarget))},l1.prototype.createTree=function(e){var t=this._rules,n=this,i={},r=[],o=new Map;function a(e,t){var n=o.get(e);if(!n){var i={element:e,depth:t};r.push(i),o.set(e,i);return}if(n.depth<t){a=n,-1!==(c=(s=r).indexOf(a))&&s.splice(c,1),r=s;var a,s,c,l={element:n.element,depth:t};r.push(l),o.set(e,l)}}eQ(eJ(e),function(e,t,i){if(!tM(e)){R(e.labels,function(e){a(e,i)}),R([e.attachers,e.incoming,e.outgoing],function(e){e&&e.length&&R(e,function(e){R(e.labels,function(e){a(e,i)}),a(e,i)})}),a(e,i);var r=[];return e.children&&(r=e.children.slice()),n._eventBus.fire("copyPaste.createTree",{element:e,children:r}),r}});var s=new Set(e=T(r,function(e){return e.element}));return r=N(r=T(r,function(t){return t.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:t.descriptor,element:t.element,elements:e,elementsSet:s}),t}),function(e){return e.descriptor.priority}),e=T(r,function(e){return e.element}),R(r,function(r){var o,a,c=r.depth;if(!n.hasRelations(r.element,e,s)||(o=r.element,a=e,!t.allowed("element.copy",{element:o,elements:a}))){l2(r.element,e),s.delete(r.element);return}i[c]||(i[c]=[]),i[c].push(r.descriptor)}),i},l3.$inject=["bpmnFactory","eventBus","moddleCopy"];let l6=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"],l9=["errorRef","escalationRef","messageRef","signalRef","dataObjectRef"];function l4(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",e=>{let{propertyNames:t}=e;if(t&&t.length)return N(t,e=>"extensionElements"===e)}),e.on("moddleCopy.canCopyProperty",e=>{let{parent:t,property:n,propertyName:i}=e,r=b(t)&&t.$descriptor;return i&&l9.includes(i)?n:!(i&&l6.includes(i))&&(!i||!r||!!S(r.properties,L({name:i})))&&void 0}),e.on("moddleCopy.canSetCopiedProperty",e=>{let{property:t}=e;if(iu(t,"bpmn:ExtensionElements")&&(!t.values||!t.values.length))return!1})}function l8(e,t){return P(e.properties,(e,n)=>t&&n.default?e:e.concat(n.name),[])}l4.$inject=["eventBus","bpmnFactory","moddle"],l4.prototype.copyElement=function(e,t,n,i=!1){n&&!v(n)&&(n=[n]),n=n||l8(e.$descriptor);let r=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t,clone:i});return!1===r||(v(r)&&(n=r),R(n,n=>{let r;E(e,n)&&(r=e.get(n));let o=this.copyProperty(r,t,n,i);g(o)&&!1!==this._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:o,propertyName:n})&&t.set(n,o)})),t},l4.prototype.copyProperty=function(e,t,n,i=!1){let r=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n,clone:i});if(!1===r)return;if(r)return b(r)&&r.$type&&!r.$parent&&(r.$parent=t),r;let o=this._moddle.getPropertyDescriptor(t,n);if(!o.isReference){if(o.isId)return e&&this._copyId(e,t,i);if(v(e))return P(e,(e,r)=>{let o=this.copyProperty(r,t,n,i);return o?e.concat(o):e},[]);if(b(e)&&e.$type){if(this._moddle.getElementDescriptor(e).isGeneric)return;return(r=this._bpmnFactory.create(e.$type)).$parent=t,r=this.copyElement(e,r,null,i)}return e}},l4.prototype._copyId=function(e,t,n=!1){return n?e:this._moddle.ids.assigned(e)?void 0:(this._moddle.ids.claim(e,t),e)};let l7={__depends__:[{__depends__:[{clipboard:["type",lV]},lJ,l0,ay],__init__:["copyPaste"],copyPaste:["type",l1]}],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",l3],moddleCopy:["type",l4]};var pe=Math.round;function pt(e,t){this._modeling=e,this._eventBus=t}function pn(e,t){t.on("replace.end",500,function(t){let{newElement:n,hints:i={}}=t;!1!==i.select&&e.select(n)})}pt.$inject=["modeling","eventBus"],pt.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var i=this._modeling,r=this._eventBus;r.fire("replace.start",{element:e,attrs:t,hints:n});var o=t.width||e.width,a=t.height||e.height,s=t.x||e.x,c=t.y||e.y,l=pe(s+o/2),p=pe(c+a/2),u=i.replaceShape(e,G({},t,{x:l,y:p,width:o,height:a}),n);return r.fire("replace.end",{element:e,newElement:u,hints:n}),u},pn.$inject=["selection","eventBus"];var pi=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function pr(e,t,n,i,r,o){this.replaceElement=function(a,s,c){c=c||{};var l,p,u,h,d,f,g,y=s.type,b=a.businessObject;if(po(b)&&("bpmn:SubProcess"===y||"bpmn:AdHocSubProcess"===y)&&(h=a&&E(a,"collapsed")?a.collapsed:!iA(a),u=s&&(E(s,"collapsed")||E(s,"isExpanded"))?E(s,"collapsed")?s.collapsed:!s.isExpanded:h,h!==u||0))return i.toggleCollapse(a),a;var _=e.create(y),x={type:y,businessObject:_};x.di={},"bpmn:ExclusiveGateway"===y&&(x.di.isMarkerVisible=!0),d=a.di,f=x.di,v(g=["fill","stroke","background-color","border-color","color"])||(g=[g]),R(g,function(e){m(d[e])||(f[e]=d[e])});
354var w=(l=l8(b.$descriptor),p=l8(_.$descriptor,!0),l.filter(function(e){return p.includes(e)}));G(_,W(s,pi));var S=C(w,function(e){return"eventDefinitions"===e?pa(a,s.eventDefinitionType):"loopCharacteristics"===e?!iT(_):!E(_,e)&&("processRef"!==e||!1!==s.isExpanded)&&"triggeredByEvent"!==e&&("isForCompensation"!==e||!iT(_))});if(_=n.copyElement(b,_,S),s.eventDefinitionType&&!pa(_,s.eventDefinitionType)&&(x.eventDefinitionType=s.eventDefinitionType,x.eventDefinitionAttrs=s.eventDefinitionAttrs),iu(b,"bpmn:Activity")){if(po(b))x.isExpanded=iA(a);else if(s&&E(s,"isExpanded")){x.isExpanded=s.isExpanded;var k=t.getDefaultSize(_,{isExpanded:x.isExpanded});x.width=k.width,x.height=k.height,x.x=a.x-(x.width-a.width)/2,x.y=a.y-(x.height-a.height)/2}iA(a)&&!iu(b,"bpmn:Task")&&x.isExpanded&&(x.width=a.width,x.height=a.height)}if(po(b)&&!po(_)&&(c.moveChildren=!1),iu(b,"bpmn:Participant")){!0===s.isExpanded?_.processRef=e.create("bpmn:Process"):c.moveChildren=!1;var P=iM(a);im(a).isHorizontal||(im(x).isHorizontal=P),x.width=P?a.width:t.getDefaultSize(x).width,x.height=P?t.getDefaultSize(x).height:a.height}return o.allowed("shape.resize",{shape:_})||(x.height=t.getDefaultSize(x).height,x.width=t.getDefaultSize(x).width),_.name=b.name,ih(b,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&ih(_,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(_.default=b.default),s.host&&!iu(b,"bpmn:BoundaryEvent")&&iu(_,"bpmn:BoundaryEvent")&&(x.host=s.host),("bpmn:DataStoreReference"===x.type||"bpmn:DataObjectReference"===x.type)&&(x.x=a.x+(a.width-x.width)/2),r.replaceElement(a,x,{...c,targetElement:s})}}function po(e){return iu(e,"bpmn:SubProcess")}function pa(e,t){var n=id(e);return t&&n.get("eventDefinitions").some(function(e){return iu(e,t)})}pr.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules"];let ps={__depends__:[l7,{__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",pn],replace:["type",pt]},rG],bpmnReplace:["type",pr]};function pc(e){this._eventBus=e,this._tools=[],this._active=null}pc.$inject=["eventBus"],pc.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw Error('A tool has to be registered with it\'s "events"');n.push(e),this.bindEvents(e,t)},pc.prototype.isActive=function(e){return e&&this._active===e},pc.prototype.length=function(e){return this._tools.length},pc.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},pc.prototype.bindEvents=function(e,t){var n=this._eventBus,i=[];n.on(t.tool+".init",function(t){!t.context.reactivate&&this.isActive(e)?this.setActive(null):this.setActive(e)},this),R(t,function(e){i.push(e+".ended"),i.push(e+".canceled")}),n.on(i,250,function(e){var t,n;this._active&&!((n=(t=e).originalEvent&&t.originalEvent.target)&&Q(n,'.group[data-group="tools"]'))&&this.setActive(null)},this)};let pl={__depends__:[af],__init__:["toolManager"],toolManager:["type",pc]};var pp=Math.abs,pu=Math.round,ph={x:"width",y:"height"},pd="crosshair",pf={n:"top",w:"left",s:"bottom",e:"right"},pm={n:"s",w:"e",s:"n",e:"w"};function pg(e,t,n,i,r,o,a){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=i,this._rules=r,this._toolManager=o,this._mouse=a;var s=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",function(e){n.once("spaceTool.selection.ended",function(){s.activateMakeSpace(e.originalEvent)})}),n.on("spaceTool.move",1500,function(e){var t=e.context,n=t.initialized;n||(n=t.initialized=s.init(e,t)),n&&pv(e)}),n.on("spaceTool.end",function(e){var t=e.context,i=t.axis,r=t.direction,o=t.movingShapes,a=t.resizingShapes,c=t.start;if(t.initialized){pv(e);var l={x:0,y:0};l[i]=pu(e["d"+i]),s.makeSpace(o,a,l,r,c),n.once("spaceTool.ended",function(e){s.activateSelection(e.originalEvent,!0,!0)})}})}function py(e){return{top:e.top-20,right:e.right+20,bottom:e.bottom+20,left:e.left-20}}function pv(e){var t,n,i=e.context.spaceToolConstraints;i&&(_(i.left)&&(t=Math.max(e.x,i.left),e.dx=e.dx+t-e.x,e.x=t),_(i.right)&&(t=Math.min(e.x,i.right),e.dx=e.dx+t-e.x,e.x=t),_(i.top)&&(n=Math.max(e.y,i.top),e.dy=e.dy+n-e.
354y,e.y=n),_(i.bottom)&&(n=Math.min(e.y,i.bottom),e.dy=e.dy+n-e.y,e.y=n))}pg.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],pg.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:pd,data:{context:{reactivate:n}},trapClick:!1})},pg.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:pd,data:{context:{}}})},pg.prototype.makeSpace=function(e,t,n,i,r){return this._modeling.createSpace(e,t,n,i,r)},pg.prototype.init=function(e,t){var n=pp(e.dx)>pp(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if(5>pp(i))return!1;i<0&&(i*=-1),rB(e)&&(i*=-1);var o=function(e,t){if("x"===e){if(t>0)return"e";if(t<0)return"w"}if("y"===e){if(t>0)return"s";if(t<0)return"n"}return null}(n,i),a=this._canvas.getRootElement();!rD(e)&&e.hover&&(a=e.hover);var s=[...e1(a),...a.attachers||[]],c=this.calculateAdjustments(s,n,i,r),l=this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}),p=function(e,t,n,i,r){var o=e.movingShapes,a=e.resizingShapes;if(a.length){var s,c,l={},p=new Set(o),u=new Set(a);return R(a,function(e){var o,a,h,d,f,m=e.attachers,g=e.children,y=tD(e),v=C(g,function(e){return!tA(e)&&!tM(e)&&!p.has(e)&&!u.has(e)}),b=C(g,function(e){return!tA(e)&&!tM(e)&&p.has(e)}),x=[],w=[];v.length&&(a=py(tD(e2(v))),o=i-y[pf[n]]+a[pf[n]],"n"===n?l.bottom=c=_(c)?Math.min(c,o):o:"w"===n?l.right=c=_(c)?Math.min(c,o):o:"s"===n?l.top=s=_(s)?Math.max(s,o):o:"e"===n&&(l.left=s=_(s)?Math.max(s,o):o)),b.length&&(o=i-py(tD(e2(b)))[pf[pm[n]]]+y[pf[pm[n]]],"n"===n?l.bottom=c=_(c)?Math.min(c,o):o:"w"===n?l.right=c=_(c)?Math.min(c,o):o:"s"===n?l.top=s=_(s)?Math.max(s,o):o:"e"===n&&(l.left=s=_(s)?Math.max(s,o):o)),m&&m.length&&(m.forEach(function(e){p.has(e)?x.push(e):w.push(e)}),x.length&&(h=tD(e2(x.map(tO))),d=y[pf[pm[n]]]-(h[pf[pm[n]]]-i)),w.length&&(f=tD(e2(w.map(tO)))[pf[n]]-(y[pf[n]]-i)),"n"===n?(o=Math.min(d||1/0,f||1/0),l.bottom=c=_(c)?Math.min(c,o):o):"w"===n?(o=Math.min(d||1/0,f||1/0),l.right=c=_(c)?Math.min(c,o):o):"s"===n?(o=Math.max(d||-1/0,f||-1/0),l.top=s=_(s)?Math.max(s,o):o):"e"===n&&(o=Math.max(d||-1/0,f||-1/0),l.left=s=_(s)?Math.max(s,o):o));var E=r&&r[e.id];E&&("n"===n?(o=i+e[ph[t]]-E[ph[t]],l.bottom=c=_(c)?Math.min(c,o):o):"w"===n?(o=i+e[ph[t]]-E[ph[t]],l.right=c=_(c)?Math.min(c,o):o):"s"===n?(o=i-e[ph[t]]+E[ph[t]],l.top=s=_(s)?Math.max(s,o):o):"e"===n&&(o=i-e[ph[t]]+E[ph[t]],l.left=s=_(s)?Math.max(s,o):o))}),l}}(c,n,o,r,l);return G(t,c,{axis:n,direction:o,spaceToolConstraints:p,start:r}),on("resize-"+("x"===n?"ew":"ns")),!0},pg.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],a=[],s=new Set,c=new Set,l=[],p=[];function u(e){s.has(e)||(s.add(e),o.push(e));var t=e.label;t&&!s.has(t)&&(s.add(t),o.push(t))}return R(e,function(e){if(!(!e.parent||tM(e))){if(tA(e))return void p.push(e);var o=e[t],s=o+e[ph[t]];if(e.host&&(n>0&&tO(e)[t]>i||n<0&&tO(e)[t]<i))return void l.push(e);if(n>0&&o>i||n<0&&s<i)return void u(e);if(o<i&&s>i&&r.allowed("shape.resize",{shape:e}))return void(!c.has(e)&&(c.add(e),a.push(e)))}}),R(o,function(e){var t=e.attachers;t&&R(t,function(e){u(e)})}),R(l,function(e){var t=e.host;(s.has(t)||c.has(t))&&u(e)}),R(p,function(e){var t=e.source,n=e.target,i=e.label;(s.has(t)||c.has(t))&&(s.has(n)||c.has(n))&&i&&u(i)}),{movingShapes:o,resizingShapes:a}},pg.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},pg.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^spaceTool/.test(e.prefix)};var pb="djs-dragging",p_="djs-resizing",px=Math.max;function pw(e,t,n,i,r){function o(e,t){R(e,function(e){r.addDragger(e,t),n.addMarker(e,pb)})}e.on("spaceTool.selection.start",function(e){var t=n.getLayer("space"),r=e.context,o=ek("g");eg(o,i.cls("djs-crosshair-group",["no-events"])),ed(t,o);var a=ek("path");eg(a,"d","M 0,-10000 L 0,10000"),ev(a).add("djs-crosshair"),ed(o,a);var s=ek("path");eg(s,"d","M -10000,0 L 10000,0"),ev(s).add("djs-crosshair"),ed(o,s),r.crosshairGroup=o}),e.on("spaceTool.selection.move",function(e){nn(e.context.crosshairGroup,e.x,e.y)}),e.on("spaceTool.selection.cleanup",function(e){var t=e.context.crosshairGroup;t&&eO(t)}),e.on("spaceTool.move",250,function(e){var t=e.context,a=t.line,s=t.axis,c=t.movingShapes,l=t.resizingShapes;if(t.initialized){if(!t.dragGroup){var p=n.getLayer("space");eg(a=ek("path"),"d","M0,0 L0,0"),ev(a).add("djs-crosshair"),ed(p,a),t.line=a;var u=ek("g");eg(u,i.cls("djs-drag-group",["no-events"])),ed(n.getActiveLayer(),u),o(c,u);var h=new Set(c);R(l,function(e){h.add(e)});var d=new Set,f=t.movingConnections=[];h.forEach(function(e){R(e.outgoing,function(e){!d.has(e)&&tA(e)&&h.has(e.target)&&(d.add(e),f.push(e))})}),o(f,u),t.dragGroup=u}if(!t.frameGroup){var m=ek("g");eg(m,i.cls("djs-frame-group",["no-events"])),ed(n.getActiveLayer(),m);var g=[];R(l,function(e){var t=r.addFrame(e,m),i=t.getBBox();g.push({element:t,initialBounds:i}),n.addMarker(e,p_)}),t.frameGroup=m,t.frames=g}eg(a,{d:{x:"M"+e.x+", -10000 L"+e.x+", 10000",y:"M -10000, "+e.y+" L 10000, "+e.y}[s]});var y={x:e.dx,y:e.dy};y[({x:"y",y:"x"})[t.axis]]=0,nn(t.dragGroup,y.x,y.y),R(t.frames,function(e){var n,i,r=e.element,o=e.initialBounds;"e"===t.direction?eg(r,{width:px(o.width+y.x,5)}):eg(r,{width:n=px(o.width-y.x,5),x:o.x+o.width-n}),"s"===t.direction?eg(r,{height:px(o.height+y.y,5)}):eg(r,{height:i=px(o.height-y.y,5),y:o.y+o.height-i})})}}),e.on("spaceTool.cleanup",function(e){var t=e.context,i=t.movingShapes,r
354=t.movingConnections,o=t.resizingShapes,a=t.line,s=t.dragGroup,c=t.frameGroup;R(i,function(e){n.removeMarker(e,pb)}),R(r,function(e){n.removeMarker(e,pb)}),s&&(eO(a),eO(s)),R(o,function(e){n.removeMarker(e,p_)}),c&&eO(c)})}function pE(e,t){e.invoke(pg,this),this._canvas=t}pw.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"],pE.$inject=["injector","canvas"],i(pE,pg),pE.prototype.calculateAdjustments=function(e,t,n,i){var r=this._canvas.getRootElement(),o=e[0]===r?null:e[0],a=[];o&&(a=D(e5(r.children.filter(e=>iu(e,"bpmn:Artifact")),e2(o))));let s=[...e,...a];var c=pg.prototype.calculateAdjustments.call(this,s,t,n,i);return c.resizingShapes=c.resizingShapes.filter(function(e){var n;return!(iu(e,"bpmn:TextAnnotation")||iu(n=e,"bpmn:Participant")&&!id(n).processRef&&("y"===t&&iM(e)||"x"===t&&!iM(e)))}),c};let pS={__depends__:[{__init__:["spaceToolPreview"],__depends__:[af,ay,pl,sl,l0],spaceTool:["type",pg],spaceToolPreview:["type",pw]}],spaceTool:["type",pE]};function pk(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}function pC(e,t){var n;if("function"!=typeof t)throw Error("removeFn iterator must be a function");if(!e)return[];for(;n=e[0];)t(n);return e}function pR(e,t,n){rp.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",1400,function(e){var t=e.context,n=t.shapes,i=t.validatedShapes;t.shapes=pP(n),t.validatedShapes=pP(i)}),i&&t.on("shape.move.start",250,function(e){var t=e.context,n=new Set(t.shapes),r=new Set;for(let e of n)for(let t of e.labels)t.hidden||n.has(t)||r.add(t),e.labelTarget&&r.add(e);for(let e of r)i.makeDraggable(t,e,!0)}
354),this.preExecuted("elements.move",1400,function(e){var t=e.context.closure,n=t.enclosedElements,i=[];R(n,function(e){R(e.labels,function(e){n[e.id]||i.push(e)})}),t.addAll(i)}),this.preExecute(["connection.delete","shape.delete"],function(e){var t=e.context;pC((t.connection||t.shape).labels,function(e){n.removeShape(e,{nested:!0})})}),this.execute("shape.delete",function(e){var t=e.context,n=t.shape,i=n.labelTarget;i&&(t.labelTargetIndex=te(i.labels,n),t.labelTarget=i,n.labelTarget=null)}),this.revert("shape.delete",function(e){var t=e.context,n=t.shape,i=t.labelTarget,r=t.labelTargetIndex;i&&(e7(i.labels,n,r),n.labelTarget=i)})}function pP(e){var t=new Set(e);return C(e,function(e){return!t.has(e.labelTarget)})}pk.$inject=["eventBus","injector"],pk.prototype.execute=function(e,t){if(!e)throw Error("command required");this._currentExecution.trigger="execute";let n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()},pk.prototype.canExecute=function(e,t){let n=this._getHandler(e),i=this._fire(e,"canExecute",{command:e,context:t});if(void 0===i){if(!n)return!1;n.canExecute&&(i=n.canExecute(t))}return i},pk.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,!1!==e&&this._fire("changed",{trigger:"clear"})},pk.prototype.undo=function(){let e=this._getUndoAction(),t;if(e){for(this._currentExecution.trigger="undo",this._pushAction(e);e&&(this._internalUndo(e),(t=this._getUndoAction())&&t.id===e.id);)e=t;this._popAction()}},pk.prototype.redo=function(){let e=this._getRedoAction(),t;if(e){for(this._currentExecution.trigger="redo",this._pushAction(e);e&&(this._internalExecute(e,!0),(t=this._getRedoAction())&&t.id===e.id);)e=t;this._popAction()}},pk.prototype.register=function(e,t){this._setHandler(e,t)},pk.prototype.registerHandler=function(e,t){if(!e||!t)throw Error("command and handlerCls must be defined");let n=this._injector.instantiate(t);this.register(e,n)},pk.prototype.canUndo=function(){return!!this._getUndoAction()},pk.prototype.canRedo=function(){return!!this._getRedoAction()},pk.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},pk.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},pk.prototype._internalUndo=function(e){let t=e.command,n=e.context,i=this._getHandler(t);this._atomicDo(()=>{this._fire(t,"revert",e),i.revert&&this._markDirty(i.revert(n)),this._revertedAction(e),this._fire(t,"reverted",e)})},pk.prototype._fire=function(e,t,n){let i;arguments.length<3&&(n=t,t=null);let r=t?[e+"."+t,t]:[e];for(let e of(n=this._eventBus.createEvent(n),r))if(i=this._eventBus.fire("commandStack."+e,n),n.cancelBubble)break;return i},pk.prototype._createId=function(){return this._uid++},pk.prototype._atomicDo=function(e){let t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},pk.prototype._internalExecute=function(e,t){let n=e.command,i=e.context,r=this._getHandler(n);if(!r)throw Error("no command handler registered for <"+n+">");this._pushAction(e),t||(this._fire(n,"preExecute",e),r.preExecute&&r.preExecute(i),this._fire(n,"preExecuted",e)),this._atomicDo(()=>{this._fire(n,"execute",e),r.execute&&this._markDirty(r.execute(i)),this._executedAction(e,t),this._fire(n,"executed",e)}),t||(this._fire(n,"postExecute",e),r.postExecute&&r.postExecute(i),this._fire(n,"postExecuted",e)),this._popAction()},pk.prototype._pushAction=function(e){let t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},pk.prototype._popAction=function(){let e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:O("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},pk.prototype._markDirty=function(e){let t=this._currentExecution;e&&(e=v(e)?e:[e],t.dirty=t.dirty.concat(e))},pk.prototype._executedAction=function(e,t){let n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},pk.prototype._revertedAction=function(e){this._stackIdx--},pk.prototype._getHandler=function(e){return this._handlerMap[e]},pk.prototype._setHandler=function(e,t){if(!e||!t)throw Error("command and handler required");if(this._handlerMap[e])throw Error("overriding handler for command <"+e+">");this._handlerMap[e]=t},i(pR,rp),pR.$inject=["injector","eventBus","modeling"];var pA="attach-ok";function pM(e,t,n,i,r){rp.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",1401,function(e){var t,n,i,r,o=e.context,a=o.shapes,s=o.validatedShapes;n=pT(t=a),o.shapes=O("id",t,n),r=j(i=s,"id"),o.validatedShapes=C(i,function(e){for(;e;){if(e.host&&r[e.host.id])return!1;e=e.parent}return!0})}),o&&t.on("shape.move.start",251,function(e){var t=e.context;R(pT(t.shapes),function(e){o.makeDraggable(t,e,!0),R(e.labels,function(e){o.makeDraggable(t,e,!0)})})}),o&&t.on("shape.move.start",function(e){var i=e.context.shapes;if(1===i.length){var r=i[0].host;r&&(n.addMarker(r,pA),t.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(r,pA)}))}}
354),this.preExecuted("elements.move",1401,function(e){var t=e.context,n=t.closure;R(pT(t.shapes),function(e){n.add(e,n.topLevel[e.host.id])})}),this.postExecuted("elements.move",function(e){var t=e.context,n=t.shapes,i=t.newHost;i&&1!==n.length||R(i?n:C(n,function(e){var t,i,r=e.host;return!!e.host&&(t=n,i=r,-1===t.indexOf(i))}),function(e){r.updateAttachment(e,i)})}),this.postExecuted("elements.move",function(e){R(e.context.shapes,function(e){R(e.attachers,function(e){R(e.outgoing.slice(),function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||r.removeConnection(e)}),R(e.incoming.slice(),function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||r.removeConnection(e)})})})}),this.postExecute("shape.create",function(e){var t=e.context,n=t.shape,i=t.host;i&&r.updateAttachment(n,i)}),this.postExecute("shape.replace",function(e){var t=e.context,n=t.oldShape,o=t.newShape;pC(n.attachers,function(e){"attach"===i.allowed("elements.move",{target:o,shapes:[e]})?r.updateAttachment(e,o):r.removeShape(e)}),o.attachers.length&&R(o.attachers,function(e){var t=cl(e,n,o);r.moveShape(e,t,e.parent)})}),this.postExecute("shape.resize",function(e){var t=e.context,n=t.shape,i=t.oldBounds,o=t.newBounds,a=n.attachers;!1!==(t.hints||{}).attachSupport&&R(a,function(e){var t=cl(e,i,o);r.moveShape(e,t,e.parent),R(e.labels,function(e){r.moveShape(e,t,e.parent)})})}
vendor: 4,312 bytes, line 354
354),this.preExecute("shape.delete",function(e){var t=e.context.shape;pC(t.attachers,function(e){r.removeShape(e)}),t.host&&r.updateAttachment(t,null)})}function pT(e){return h(T(e,function(e){return e.attachers||[]}))}function pB(e){this._model=e}function pD(e,t,n){rp.call(this,e),this._bpmnFactory=t;var i=this;function r(e){R(e.context.oldRoot.children,function(e){iu(e,"bpmn:BaseElement")&&i.updateParent(e)})}function o(e){var t=e.context.shape;iu(t,"bpmn:BaseElement")&&i.updateBounds(t)}function a(e){i.updateConnection(e.context)}function s(e){i.updateConnectionWaypoints(e.context.connection)}function c(e){i.updateAttachment(e.context)}function l(e){let{element:n}=e.context,i=i$(n),r=im(n),o=r&&r.get("label");ij(n)||rv(n)||(i&&!o?r.set("label",t.create("bpmndi:BPMNLabel")):!i&&o&&r.set("label",void 0))}this.executed(["connection.layout","connection.create"],function(e){var t,i=e.context,r=i.hints||{};i.cropped||!1===r.createElementsBehavior||((t=i.connection).waypoints=n.getCroppedWaypoints(t),i.cropped=!0)}),this.reverted(["connection.layout"],function(e){delete e.context.cropped}),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],pj(function(e){var t=e.context;i.updateParent(t.shape||t.connection,t.oldParent)})),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],pj(function(e){var t=e.context,n=t.shape||t.connection,r=t.parent||t.newParent;i.updateParent(n,r)})),this.executed(["canvas.updateRoot"],r),this.reverted(["canvas.updateRoot"],r),this.executed(["shape.move","shape.create","shape.resize"],pj(function(e){"label"!==e.context.shape.type&&o(e)})),this.reverted(["shape.move","shape.create","shape.resize"],pj(function(e){"label"!==e.context.shape.type&&o(e)})),e.on("shape.changed",function(e){"label"===e.element.type&&o({context:{shape:e.element}})}),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],pj(a)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],pj(a)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],pj(s)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],pj(s)),this.executed("connection.reconnect",pj(function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=id(n),a=id(i),s=id(r);o.conditionExpression&&!ih(s,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(t.oldConditionExpression=o.conditionExpression,delete o.conditionExpression),i!==r&&a.default===o&&(t.oldDefault=a.default,delete a.default)})),this.reverted("connection.reconnect",pj(function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=id(n),a=id(i),s=id(r);t.oldConditionExpression&&(o.conditionExpression=t.oldConditionExpression),t.oldDefault&&(a.default=t.oldDefault,delete s.default)})),this.executed(["element.updateAttachment"],pj(c)),this.reverted(["element.updateAttachment"],pj(c)),this.executed("element.updateLabel",pj(l)),this.reverted("element.updateLabel",pj(l))}function pj(e){return function(t){var n=t.context;iu(n.shape||n.connection||n.element,"bpmn:BaseElement")&&e(t)}}i(pM,rp),pM.$inject=["injector","eventBus","canvas","rules","modeling"],pB.$inject=["moddle"],pB.prototype._needsId=function(e){return ih(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},pB.prototype._ensureId=function(e){var t;e.id?this._model.ids.claim(e.id,e):(t=(iu(e,"bpmn:Activity")?"Activity":iu(e,"bpmn:Event")?"Event":iu(e,"bpmn:Gateway")?"Gateway":ih(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(e.$type||"").replace(/^[^:]*:/g,""))+"_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e)))},pB.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},pB.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},pB.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",G({bpm
354nElement:e,bounds:this.createDiBounds()},t))},pB.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},pB.prototype.createDiWaypoints=function(e){var t=this;return T(e,function(e){return t.createDiWaypoint(e)})},pB.prototype.createDiWaypoint=function(e){return this.create("dc:Point",W(e,["x","y"]))},pB.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",G({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))},pB.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",G({bpmnElement:e},t))},i(pD,rp),pD.$inject=["eventBus","bpmnFactory","connectionDocking"],pD.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},pD.prototype.updateParent=function(e,t){if(!tM(e)&&!(iu(e,"bpmn:DataStoreReference")&&e.parent&&iu(e.parent,"bpmn:Collaboration"))){var n=e.parent,i=e.businessObject,r=im(e),o=n&&n.businessObject,a=im(n);iu(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,o,t&&t.businessObject),iu(e,"bpmn:DataOutputAssociation")&&(o=e.source?e.source.businessObject:null),iu(e,"bpmn:DataInputAssociation")&&(o=e.target?e.target.businessObject:null),this.updateSemanticParent(i,o),iu(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,o),this.updateDiParent(r,a)}},pD.prototype.updateBounds=function(e){var t=im(e),n=function(e){if(iu(e,"bpmn:Activity")){var t=im(e);if(t){var n=t.get("label");if(n)return n.get("bounds")}}}(e);if(n){var i=oo(n,t.get("bounds"));G(n,{x:e.x+i.x,y:e.y+i.y})}var r=tM(e)?this._getLabel(t):t,o=r.bounds;o||(o=this._bpmnFactory.createDiBounds(),r.set("bounds",o)),G(o,{x:e.x,y:e.y,width:e.width,height:e.height})},pD.prototype.updateFlowNodeRefs=function(e,t,n){n!==t&&(iu(n,"bpmn:Lane")&&e8(n.get("flowNodeRef"),e),iu(t,"bpmn:Lane")&&e7(t.get("flowNodeRef"),e))},pD.prototype.updateDiConnection=function(e,t,n){var i=im(e),r=im(t),o=im(n);i.sourceElement&&i.sourceElement.bpmnElement!==id(t)&&(i.sourceElement=t&&r),i.targetElement&&i.targetElement.bpmnElement!==id(n)&&(i.targetElement=n&&o)},pD.prototype.updateDiParent=function(e,t){if(t&&!iu(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(e8(n,e),e.$parent=null)}},pD.prototype.getLaneSet=function(e){var t,n;return iu(e,"bpmn:Lane")?(t=e.childLaneSet)||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e):(iu(e,"bpmn:Participant")&&(e=e.processRef),(t=(n=e.get("laneSets"))[0])||((t=this._bpmnFactory.create("bpmn:LaneSet")).$parent=e,n.push(t))),t},pD.prototype.updateSemanticParent=function(e,t,n){if(e.$parent!==t&&(!(iu(e,"bpmn:DataInput")||iu(e,"bpmn:DataOutput"))||(iu(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),!("ioSpecification"in t)||t.ioSpecification!==e.$parent))){if(iu(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),o="lanes";else if(iu(e,"bpmn:FlowElement")){if(t){if(iu(t,"bpmn:Participant"))t=t.processRef;else if(iu(t,"bpmn:Lane"))do t=t.$parent.$parent;while(iu(t,"bpmn:Lane"))}o="flowElements"}else if(iu(e,"bpmn:Artifact")){for(;t&&!iu(t,"bpmn:Process")&&!iu(t,"bpmn:SubProcess")&&!iu(t,"bpmn:Collaboration");)if(iu(t,"bpmn:Participant")){t=t.processRef;break}else t=t.$parent;o="artifacts"}else if(iu(e,"bpmn:MessageFlow"))o="messageFlows";else if(iu(e,"bpmn:Participant")){var i,r,o="participants",a=e.processRef;a&&(r=function(e){for(;e&&!iu(e,"bpmn:Definitions");)e=e.$parent;return e}(e.$parent||t),e.$parent&&(e8(r.get("rootElements"),a),a.$parent=null),t&&(e7(r.get("rootElements"),a),a.$parent=r))}else iu(e,"bpmn:DataOutputAssociation")?o="dataOutputAssociations":iu(e,"bpmn:DataInputAssociation")&&(o="dataInputAssociations");if(!o)throw Error(`no parent for <${e.id}> in <${t.id}>`);if(e.$parent&&e8(i=e.$parent.get(o),e),t?((i=t.get(o)).push(e),e.$parent=t):e.$parent=null,n){var s=n.get(o);e8(i,e),t&&(s||(s=[],t.set(o,s)),s.push(e))}}},pD.prototype.updateConnectionWaypoints=function(e){im(e).set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},pD.prototype.updateConnection=function(e){var t,n=e.connection,i=id(n),r=n.source,o=id(r),a=n.target,s=id(n.target);if(iu(i,"bpmn:DataAssociation"))iu(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=o,t=e.parent||e.newParent||s,this.updateSemanticParent(i,s,t)):iu(i,"bpmn:DataOutputAssociation")&&(t=e.parent||e.newParent||o,this.updateSemanticParent(i,o,t),i.targetRef=s);else{var c=iu(i,"bpmn:SequenceFlow");i.sourceRef!==o&&(c&&(e8(i.sourceRef&&i.sourceRef.get("outgoing"),i),o&&o.get("outgoing")&&o.get("outgoing").push(i)),i.sourceRef=o),i.targetRef!==s&&(c&&(e8(i.targetRef&&i.targetRef.get("incoming"),i),s&&s.get("incoming")&&s.get("incoming").push(i)),i.targetRef=s)}this.updateConnectionWaypoints(n),this.updateDiConnection(n,r,a)},pD.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label};let pO={width:100,height:80},pN={width:100,height:80},pL={width:50,height:50},p$={width:36,height:36},pI={width:350,height:200},pF={width:100,height:80},pz={width:600,height:250},pH={width:250,height:600},pV={width:400,height:60},pG={width:60,height:400},pW={width:400,height:100},pU={width:36,height:50},pq={width:50,height:50},pK={width:100,height:40},pY={width:300,height:300};function pX(e,t){t6.call(this),this._bpmnFactory=e,this._moddle=t}function pZ(e,t,n){return void 0===t[n]?t:(e[n]=t[n],U(t,[n]))}function pJ(e,t){this._modeling=e,this._canvas=t}function pQ(e){this._modeling=e}function p0(e,t){this._canvas=e,this._layouter=t}i(pX,t6),pX.$inject=["bpmnFactory","moddle"],pX.prototype._baseCreate=t6.prototype.create,pX.prototype.create=function(e,t){if("label"===e){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,G({type:"label",di:n},iD,t))}return this.createElement(e,t)}
354,pX.prototype.createElement=function(e,t){var n,i,r,o,a,s=(t=G({},t||{})).businessObject,c=t.di;if(!s){if(!t.type)throw Error("no shape type specified");s=this._bpmnFactory.create(t.type)}if(!ih(c,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])){var l=G({},c||{},{id:s.id+"_di"});c="root"===e?this._bpmnFactory.createDiPlane(s,l):"connection"===e?this._bpmnFactory.createDiEdge(s,l):this._bpmnFactory.createDiShape(s,l)}return iu(s,"bpmn:Group")&&(t=G({isFrame:!0},t)),(n=s,i=t,R(["processRef","isInterrupting","associationDirection","isForCompensation"],function(e){i=pZ(n,i,e)}),t=i).isExpanded&&(t=pZ(c,t,"isExpanded")),ih(s,["bpmn:Lane","bpmn:Participant"])&&(t=pZ(c,t,"isHorizontal")),iu(s,"bpmn:SubProcess")&&(t.collapsed=!iA(s,c)),iu(s,"bpmn:ExclusiveGateway")&&(E(c,"isMarkerVisible")?void 0===c.isMarkerVisible&&(c.isMarkerVisible=!1):c.isMarkerVisible=!0),g(t.triggeredByEvent)&&(s.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),g(t.cancelActivity)&&(s.cancelActivity=t.cancelActivity,delete t.cancelActivity),t.eventDefinitionType&&(o=s.get("eventDefinitions")||[],a=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),"bpmn:ConditionalEventDefinition"===t.eventDefinitionType&&(a.condition=this._bpmnFactory.create("bpmn:FormalExpression")),o.push(a),a.$parent=s,s.eventDefinitions=o,delete t.eventDefinitionType),r=this.getDefaultSize(s,c),t=G({id:s.id},r,t,{businessObject:s,di:c}),this._baseCreate(e,t)},pX.prototype.getDefaultSize=function(e,t){var n=t;let i=id(e);if(n=n||im(e),iu(i,"bpmn:SubProcess"))if(iA(i,n))return{...pI};else return{...pF};if(iu(i,"bpmn:Task"))return{...pN};if(iu(i,"bpmn:Gateway"))return{...pL};if(iu(i,"bpmn:Event"))return{...p$};if(iu(i,"bpmn:Participant")){let e=!n||void 0===n.isHorizontal||!0===n.isHorizontal;return iA(i,n)?e?{...pz}:{...pH}:e?{...pV}:{...pG}}return iu(i,"bpmn:Lane")?{...pW}:iu(i,"bpmn:DataObjectReference")?{...pU}:iu(i,"bpmn:DataStoreReference")?{...pq}:iu(i,"bpmn:TextAnnotation")?{...pK}:iu(i,"bpmn:Group")?{...pY}:{...pO}},pX.prototype.createParticipantShape=function(e){return b(e)||(e={isExpanded:e}),!1!==(e=G({type:"bpmn:Participant"},e||{})).isExpanded&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)},pJ.$inject=["modeling","canvas"],pJ.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;R(n,function(e){var n={x:0,y:0};g(i.left)?n.x=i.left-e.x:g(i.right)?n.x=i.right-e.width-e.x:g(i.center)?n.x=i.center-Math.round(e.width/2)-e.x:g(i.top)?n.y=i.top-e.y:g(i.bottom)?n.y=i.bottom-e.height-e.y:g(i.middle)&&(n.y=i.middle-Math.round(e.height/2)-e.y),t.moveElements([e],n,e.parent)})},pJ.prototype.postExecute=function(e){},pQ.$inject=["modeling"],pQ.prototype.preExecute=function(e){var t=e.source;if(!t)throw Error("source required");var n=e.target||t.parent,i=e.shape,r=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,n,{attach:r.attach}),e.shape=i},pQ.prototype.postExecute=function(e){var t,n,i=e.hints||{};t=e.source,n=e.shape,M(t.outgoing,function(e){return e.target===n})||(i.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))},p0.$inject=["canvas","layouter"],p0.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,r=e.parent,o=e.parentIndex,a=e.hints;if(!n||!i)throw Error("source and target required");if(!r)throw Error("parent required");return t.source=n,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,r,o),t},p0.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var p1=Math.round;function p2(e){this._modeling=e}p2.$inject=["modeling"],p2.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,a=this._modeling;R(t,function(e){_(e.x)||(e.x=0),_(e.y)||(e.y=0)});var s=e2(C(t,function(e){return!e.hidden}));R(t,function(e){tA(e)&&(e.waypoints=T(e.waypoints,function(e){return{x:p1(e.x-s.x-s.width/2+r.x),y:p1(e.y-s.y-s.height/2+r.y)}})),G(e,{x:p1(e.x-s.x-s.width/2+r.x),y:p1(e.y-s.y-s.height/2+r.y)})});var c=new Set(eJ(t)),l={};R(t,function(e){if(tA(e)){l[e.id]=_(i)?a.createConnection(l[e.source.id],l[e.target.id],i,e,e.parent||n,o):a.createConnection(l[e.source.id],l[e.target.id],e,e.parent||n,o);return}var t=G({},o);c.has(e)||(t.autoResize=!1),tM(e)&&(t=U(t,["attach"])),l[e.id]=_(i)?a.createShape(e,W(e,["x","y","width","height"]),e.parent||n,i,t):a.createShape(e,W(e,["x","y","width","height"]),e.parent||n,t)}),e.elements=D(l)};var p5=Math.round;function p3(e){this._canvas=e}function p6(e){p3.call(this,e)}p3.$inject=["canvas"],p3.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent,r=e.parentIndex;if(!i)throw Error("parent required");if(!n)throw Error("position required");return void 0!==n.width?G(t,n):G(t,{x:n.x-p5(t.width/2),y:n.y-p5(t.height/2)}),this._canvas.addShape(t,i,r),t},p3.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t},i(p6,p3),p6.$inject=["canvas"];var p9=p3.prototype.execute;p6.prototype.execute=function(e){var t,n=e.shape;return t=n,["width","height"].forEach(function(e){void 0===t[e]&&(t[e]=0)}),n.labelTarget=e.labelTarget,p9.call(this,e)};var p4=p3.prototype.revert;function p8(e,t){this._canvas=e,this._modeling=t}function p7(e,t){this._modeling=e,this._elementRegistry=t}function ue(e,t){this._canvas=e,this._modeling=t}function ut(e){this._modeling=e}p6.prototype.revert=function(e){return e.shape.labelTarget=null,p4.call(this,e)},p8.$inject=["canvas","modeling"],p8.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;pC(n.incoming,function(e){t.removeConnection(e,{nested:!0})}),pC(n.outgoing,function(e){t.removeConnection(e,{nested:!0})})},p8.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=te(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},p8.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,e7(n.children,t,i),this._canvas.addConnection(t,n),t},p7.$inject=["modeling","elementRegistry"],p7.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry;R(e.elements,function(e){n.get(e.id)&&(e.waypoints?t.removeConnection(e):t.removeShape(e))})},ue.$inject=["canvas","modeling"],ue.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;pC(n.incoming,function(e){t.removeConnection(e,{nested:!0})}),pC(n.outgoing,function(e){t.removeConnection(e,{nested:!0})}
354),pC(n.children,function(e){tA(e)?t.removeConnection(e,{nested:!0}):t.removeShape(e,{nested:!0})})},ue.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=te(i.children,n),t.removeShape(n),n},ue.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return e7(i.children,n,r),t.addShape(n,i),n},ut.$inject=["modeling"];var un={x:"y",y:"x"};function ui(e,t){this._layouter=e,this._canvas=t}function ur(){}function uo(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function ua(e){this._modeling=e}function us(e){this._helper=new ua(e)}function uc(e){this._modeling=e,this._helper=new ua(e)}function ul(e){this._modeling=e}function up(e){return e.original||e}function uu(e,t){this._modeling=e,this._rules=t}function uh(e){this._modeling=e}function ud(e){this._modeling=e}function uf(e){switch(e){case"n":case"s":return"y";case"w":case"e":return"x"}}function um(e,t,n){var i=uf(n);return/e|s/.test(n)?e[i]>t:/n|w/.test(n)?e[i]<t:void 0}function ug(e){this._modeling=e}function uy(e){this._modeling=e}function uv(e,t){return e8(e&&e.attachers,t)}function ub(e,t,n){if(e){var i=e.attachers;i||(e.attachers=i=[]),e7(i,t,n)}}function u_(){}function ux(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var i=this;e.on("diagram.init",function(){i.registerHandlers(n)})}function uw(e){this._elementRegistry=e}function uE(e,t){R(t,function(t,n){e.set(n,t)})}ut.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,i=e.axis,r=e.dimension;function o(e,t){e.range.min=Math.min(t[i],e.range.min),e.range.max=Math.max(t[i]+t[r],e.range.max)}function a(e){return e[i]+e[r]/2}var s,c=n[0],l=n.length-1,p=n[l],u=0;R(n,function(e,s){var c,p,h,d,f;if(e.elements.length<2){s&&s!==n.length-1&&(o(e,e.elements[0]),u+=(d=e.range).max-d.min);return}p=(c=N(e.elements,i))[0],s===l&&(p=c[c.length-1]),h=a(p),e.range=null,R(c,function(n){var s;if((s={y:0})[i]=h-a(n),s[i]&&(s[un[i]]=0,t.moveElements([n],s,n.parent)),null===e.range){e.range={min:n[i],max:n[i]+n[r]};return}o(e,n)}),s&&s!==n.length-1&&(u+=(f=e.range).max-f.min)}),(s=Math.round((Math.abs(p.range.min-c.range.max)-u)/(n.length-1)))<n.length-1||R(n,function(e,o){var a,l={};e!==c&&e!==p&&(a=n[o-1],e.range.max=0,R(e.elements,function(n,o){l[un[i]]=0,l[i]=a.range.max-n[i]+s,e.range.min!==n[i]&&(l[i]+=n[i]-e.range.min),l[i]&&t.moveElements([n],l,n.parent),e.range.max=Math.max(n[i]+n[r],o?e.range.max:0)}))})},ut.prototype.postExecute=function(e){},ui.$inject=["layouter","canvas"],ui.prototype.execute=function(e){var t=e.connection;return G(e,{oldWaypoints:t.waypoints}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},ui.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t},ur.prototype.execute=function(e){var t=e.connection,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldParent=o,e.oldParentIndex=e8(o.children,t),e7(i.children,t,r),t.parent=i,R(t.waypoints,function(e){e.x+=n.x,e.y+=n.y,e.original&&(e.original.x+=n.x,e.original.y+=n.y)}),t},ur.prototype.revert=function(e){var t=e.connection,n=t.parent,i=e.oldParent,r=e.oldParentIndex,o=e.delta;return e8(n.children,t),e7(i.children,t,r),t.parent=i,R(t.waypoints,function(e){e.x-=o.x,e.y-=o.y,e.original&&(e.original.x-=o.x,e.original.y-=o.y)}),t},uo.prototype.add=function(e,t){return this.addAll([e],t)},uo.prototype.addAll=function(e,t){return G(this,function(e,t,n){m(t)&&(t=!0),b(t)&&(n=t,t=!0);var i=e9((n=n||{}).allShapes),r=e9(n.allConnections),o=e9(n.enclosedElements),a=e9(n.enclosedConnections),s=e9(n.topLevel,t&&j(e,function(e){return e.id}));function c(e){s[e.source.id]&&s[e.target.id]&&(s[e.id]=[e]),i[e.source.id]&&i[e.target.id]&&(a[e.id]=o[e.id]=e),r[e.id]=e}return eQ(e,function(e){if(o[e.id]=e,!e.waypoints)return i[e.id]=e,R(e.incoming,c),R(e.outgoing,c),e.children;a[e.id]=r[e.id]=e}),{allShapes:i,allConnections:r,topLevel:s,enclosedConnections:a,enclosedElements:o}}(e,!!t,this)),this},ua.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},ua.prototype.moveClosure=function(e,t,n,i,r){var o=this._modeling,a=e.allShapes,s=e.allConnections,c=e.enclosedConnections,l=e.topLevel,p=!1;r&&r.parent===n&&(p=!0),R(a,function(e){o.moveShape(e,t,l[e.id]&&!p&&n,{recurse:!1,layout:!1})}),R(s,function(e){var i=!!a[e.source.id],r=!!a[e.target.id];c[e.id]&&i&&r?o.moveConnection(e,t,l[e.id]&&!p&&n):o.layoutConnection(e,{connectionStart:i&&cv(e,e.source,t),connectionEnd:r&&cb(e,e.target,t)})})},ua.prototype.getClosure=function(e){return new uo().addAll(e,!0)},us.$inject=["modeling"],us.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},us.prototype.postExecute=function(e){var t,n=e.hints;n&&n.primaryShape&&(t=n.primaryShape,n.oldParent=t.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,t)},uc.$inject=["modeling"],uc.prototype.execute=function(e){var t=e.shape,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldBounds=W(t,["x","y","width","height"]),e.oldParent=o,e.oldParentIndex=e8(o.children,t),e7(i.children,t,r),G(t,{parent:i,x:t.x+n.x,y:t.y+n.y}),t},uc.prototype.postExecute=function(e){var t=e.shape,n=e.delta,i=e.hints,r=this._modeling;!1!==i.layout&&(R(t.incoming,function(e){r.layoutConnection(e,{connectionEnd:cb(e,t,n)})}),R(t.outgoing,function(e){r.layoutConnection(e,{connectionStart:cv(e,t,n)})})),!1!==i.recurse&&this.moveChildren(e)},uc.prototype.revert=function(e){var t=e.shape,n=e.oldParent,i=e.oldParentIndex,r=e.delta;return e7(n.children,t,i),G(t,{parent:n,x:t.x-r.x,y:t.y-r.y}),t},uc.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},uc.prototype.getNewParent=function(e){return e.newParent||e.shape.parent},ul.$inject=["modeling"],ul.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,i=e.connection,r=e.dockingOrPoints;if(!t&&!n)throw Error("newSource or newTarget required");return v(r)&&(e.oldWaypoints=i.waypoints,i.waypoints=r),t&&(e.oldSource=i.source,i.source=t),n&&(e.oldTarget=i.target,i.target=n),i},ul.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,i=e.newTarget,r=e.dockingOrPoints,o=e.hints||{},a={};o.connectionStart&&(a.connectionStart=o.connectionStart),o.connectionEnd&&(a.connectionEnd=o.connectionEnd),!1!==o.layoutConnection&&(n&&(!i||"source"===o.docking)&&(a.connectionStart=a.connectionStart||up(v(r)?r[0]:r)),i&&(!n||"target"===o.docking)&&(a.connectionEnd=a.connectionEnd||up(v(r)?r[r.length-1]:r)),o.newWaypoints&&(a.waypoints=o.newWaypoints),this._modeling.layoutConnection(t,a))},ul.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,i=e.oldWaypoints,r=e.connection;return t&&(r.source=t),n&&(r.target=n),i&&(r.waypoints=i),r},uu.$inject=["modeling","rules"],uu.prototype.preExecute=function(e){var t,n,i=this,r=this._modeling,o=this._rules,a=e.oldShape,s=e.newData,c=e.hints||{};function l(e,t,n){return o.allowed("connection.reconnect",{connection:n,source:e,target:t})}var p={x:s.x,y:s.y},u={x:a.x,y:a.y,width:a.width,height:a.height};n=e.newShape=e.newShape||i.createShape(s,p,a.parent,c),a.host&&r.updateAttachment(n,a.host),!1!==c.moveChildren&&(t=a.children.slice(),r.moveElements(t,{x:0,y:0},n,c));var h=a.incoming.slice(),d=a.outgoing.slice();
354R(h,function(e){l(e.source,n,e)&&i.reconnectEnd(e,n,cy(e,n,u),c)}),R(d,function(e){l(n,e.target,e)&&i.reconnectStart(e,n,cg(e,n,u),c)})},uu.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},uu.prototype.execute=function(e){},uu.prototype.revert=function(e){},uu.prototype.createShape=function(e,t,n,i){return this._modeling.createShape(e,t,n,i)},uu.prototype.reconnectStart=function(e,t,n,i){this._modeling.reconnectStart(e,t,n,i)},uu.prototype.reconnectEnd=function(e,t,n,i){this._modeling.reconnectEnd(e,t,n,i)},uh.$inject=["modeling"],uh.prototype.execute=function(e){var t=e.shape,n=e.newBounds,i=e.minBounds;if(void 0===n.x||void 0===n.y||void 0===n.width||void 0===n.height)throw Error("newBounds must have {x, y, width, height} properties");if(i&&(n.width<i.width||n.height<i.height))throw Error("width and height cannot be less than minimum height and width");if(!i&&n.width<10||n.height<10)throw Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},G(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},uh.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,i=e.oldBounds;!1!==(e.hints||{}).layout&&(R(n.incoming,function(e){t.layoutConnection(e,{connectionEnd:cy(e,n,i)})}),R(n.outgoing,function(e){t.layoutConnection(e,{connectionStart:cg(e,n,i)})}))},uh.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return G(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},ud.$inject=["modeling"],ud.prototype.preExecute=function(e){var t,n,i,r=e.delta,o=e.direction,a=e.movingShapes,s=e.resizingShapes,c=e.start,l={};this.moveShapes(a,r),R(s,function(e){var t;l[e.id]={x:(t=e).x,y:t.y,height:t.height,width:t.width}}),this.resizeShapes(s,r,o),this.updateConnectionWaypoints((t=[],n=new Set(a),R(s,function(e){n.add(e)}),i=new Set,n.forEach(function(e){var r=e.incoming,o=e.outgoing;R(r.concat(o),function(e){var r=e.source,o=e.target;(n.has(r)||n.has(o))&&!i.has(e)&&(i.add(e),t.push(e))})}),t),r,o,c,a,s,l)},ud.prototype.execute=function(){},ud.prototype.revert=function(){},ud.prototype.moveShapes=function(e,t){var n=this;R(e,function(e){n._modeling.moveShape(e,t,null,{autoResize:!1,layout:!1,recurse:!1})})},ud.prototype.resizeShapes=function(e,t,n){var i=this;R(e,function(e){var r=function(e,t,n){var i=e.x,r=e.y,o=e.width,a=e.height,s=n.x,c=n.y;switch(t){case"n":return{x:i,y:r+c,width:o,height:a-c};case"s":return{x:i,y:r,width:o,height:a+c};case"w":return{x:i+s,y:r,width:o-s,height:a};case"e":return{x:i,y:r,width:o+s,height:a};default:throw Error("unknown direction: "+t)}}(e,n,t);i._modeling.resizeShape(e,r,null,{attachSupport:!1,autoResize:!1,layout:!1})})},ud.prototype.updateConnectionWaypoints=function(e,t,n,i,r,o,a){var s=this,c=new Set(r),l=new Set(o);R(e,function(e){var r=e.source,o=e.target,p=T(e.waypoints,function(e){return(e=G({},e)).original&&(e.original=G({},e.original)),e}),u=uf(n),h={},d=c.has(r)||l.has(r),f=c.has(o)||l.has(o);d&&f?(p=T(p,function(e){return um(e,i,n)&&(e[u]=e[u]+t[u]),e.original&&um(e.original,i,n)&&(e.original[u]=e.original[u]+t[u]),e}),s._modeling.updateWaypoints(e,p,{labelBehavior:!1})):(d||f)&&(c.has(r)?h.connectionStart=cv(e,r,t):c.has(o)?h.connectionEnd=cb(e,o,t):l.has(r)?h.connectionStart=cg(e,r,a[r.id]):l.has(o)&&(h.connectionEnd=cy(e,o,a[o.id])),s._modeling.layoutConnection(e,h))})},ug.$inject=["modeling"],ug.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=function e(t){var n={};return R(t,function(t){n[t.id]=t.hidden,t.children&&(n=G({},n,e(t.children)))}),n}(n),t.collapsed=!t.collapsed;var i=function e(t,n){var i=[];return R(t,function(t){t.hidden=n,i=i.concat(t),t.children&&(i=i.concat(e(t.children,t.collapsed||n)))}),i}(n,t.collapsed);return[t].concat(i)},ug.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,i=function e(t,n){var i=[];return R(t,function(t){t.hidden=n[t.id],i=i.concat(t),t.children&&(i=i.concat(e(t.children,n)))}),i}(t.children,n);return t.collapsed=!t.collapsed,[t].concat(i)},uy.$inject=["modeling"],uy.prototype.execute=function(e){var t=e.shape,n=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=uv(i,t),ub(n,t),t.host=n,t},uy.prototype.revert=function(e){var t=e.shape,n=e.newHost,i=e.oldHost,r=e.attacherIdx;return t.host=i,uv(n,t),ub(i,t,r),t},u_.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;
vendor: 5,193 bytes, line 354
354return e.oldWaypoints=t.waypoints,t.waypoints=n,t},u_.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t},ux.$inject=["eventBus","elementFactory","commandStack"],ux.prototype.getHandlers=function(){return{"shape.append":pQ,"shape.create":p3,"shape.delete":ue,"shape.move":uc,"shape.resize":uh,"shape.replace":uu,"shape.toggleCollapse":ug,spaceTool:ud,"label.create":p6,"connection.create":p0,"connection.delete":p8,"connection.move":ur,"connection.layout":ui,"connection.updateWaypoints":u_,"connection.reconnect":ul,"elements.create":p2,"elements.move":us,"elements.delete":p7,"elements.distribute":ut,"elements.align":pJ,"element.updateAttachment":uy}},ux.prototype.registerHandlers=function(e){R(this.getHandlers(),function(t,n){e.registerHandler(n,t)})},ux.prototype.moveShape=function(e,t,n,i,r){"object"==typeof i&&(r=i,i=null);var o={shape:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)},ux.prototype.updateAttachment=function(e,t){this._commandStack.execute("element.updateAttachment",{shape:e,newHost:t})},ux.prototype.moveElements=function(e,t,n,i){var r,o=(i=i||{}).attach,a=n;!0===o?(r=n,a=n.parent):!1===o&&(r=null);var s={shapes:e,delta:t,newParent:a,newHost:r,hints:i};this._commandStack.execute("elements.move",s)},ux.prototype.moveConnection=function(e,t,n,i,r){"object"==typeof i&&(r=i,i=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)},ux.prototype.layoutConnection=function(e,t){this._commandStack.execute("connection.layout",{connection:e,hints:t||{}})},ux.prototype.createConnection=function(e,t,n,i,r,o){"object"==typeof n&&(o=r,r=i,i=n,n=void 0);var a={source:e,target:t,parent:r,parentIndex:n,connection:i=this._create("connection",i),hints:o};return this._commandStack.execute("connection.create",a),a.connection},ux.prototype.createShape=function(e,t,n,i,r){"number"!=typeof i&&(r=i,i=void 0);var o,a,s=(r=r||{}).attach;e=this._create("shape",e),s?(o=n.parent,a=n):o=n;var c={position:t,shape:e,parent:o,parentIndex:i,host:a,hints:r};return this._commandStack.execute("shape.create",c),c.shape},ux.prototype.createElements=function(e,t,n,i,r){v(e)||(e=[e]),"number"!=typeof i&&(r=i,i=void 0);var o={position:t,elements:e,parent:n,parentIndex:i,hints:r=r||{}};return this._commandStack.execute("elements.create",o),o.elements},ux.prototype.createLabel=function(e,t,n,i){n=this._create("label",n);var r={labelTarget:e,position:t,parent:i||e.parent,shape:n};return this._commandStack.execute("label.create",r),r.shape},ux.prototype.appendShape=function(e,t,n,i,r){r=r||{};var o={source:e,position:n,target:i,shape:t=this._create("shape",t),connection:r.connection,connectionParent:r.connectionParent,hints:r};return this._commandStack.execute("shape.append",o),o.shape},ux.prototype.removeElements=function(e){this._commandStack.execute("elements.delete",{elements:e})},ux.prototype.distributeElements=function(e,t,n){this._commandStack.execute("elements.distribute",{groups:e,axis:t,dimension:n})},ux.prototype.removeShape=function(e,t){this._commandStack.execute("shape.delete",{shape:e,hints:t||{}})},ux.prototype.removeConnection=function(e,t){this._commandStack.execute("connection.delete",{connection:e,hints:t||{}})},ux.prototype.replaceShape=function(e,t,n){var i={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},ux.prototype.alignElements=function(e,t){this._commandStack.execute("elements.align",{elements:e,alignment:t})},ux.prototype.resizeShape=function(e,t,n,i){this._commandStack.execute("shape.resize",{shape:e,newBounds:t,minBounds:n,hints:i})},ux.prototype.createSpace=function(e,t,n,i,r){this._commandStack.execute("spaceTool",{delta:n,direction:i,movingShapes:e,resizingShapes:t,start:r})},ux.prototype.updateWaypoints=function(e,t,n){this._commandStack.execute("connection.updateWaypoints",{connection:e,newWaypoints:t,hints:n||{}})},ux.prototype.reconnect=function(e,t,n,i,r){this._commandStack.execute("connection.reconnect",{connection:e,newSource:t,newTarget:n,dockingOrPoints:i,hints:r||{}})},ux.prototype.reconnectStart=function(e,t,n,i){i||(i={}),this.reconnect(e,t,e.target,n,G(i,{docking:"source"}))},ux.prototype.reconnectEnd=function(e,t,n,i){i||(i={}),this.reconnect(e,e.source,t,n,G(i,{docking:"target"}))},ux.prototype.connect=function(e,t,n,i){return this.createConnection(e,t,n||{},e.parent,i)},ux.prototype._create=function(e,t){return t instanceof tQ?t:this._elementFactory.create(e,t)},ux.prototype.toggleCollapse=function(e,t){this._commandStack.execute("shape.toggleCollapse",{shape:e,hints:t||{}})},uw.$inject=["elementRegistry"],uw.prototype.execute=function(e){var t,n=e.element,i=e.moddleElement,r=e.properties;if(!i)throw Error("<moddleElement> required");var o=e.changed||this._getVisualReferences(i).concat(n),a=e.oldProperties||(t=i,P(B(r),function(e,n){return e[n]=t.get(n),e},{}));return uE(i,r),e.oldProperties=a,e.changed=o,o},uw.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return uE(n,t),i},uw.prototype._getVisualReferences=function(e){var t,n=this._elementRegistry;
354return iu(e,"bpmn:DataObject")?(t=e,n.filter(function(e){return iu(e,"bpmn:DataObjectReference")&&id(e).dataObjectRef===t})):[]};var uS="default",uk={width:0,height:0};function uC(e,t,n,i){this._elementRegistry=e,this._moddle=t,this._modeling=n,this._textRenderer=i}function uR(e,t){return"id"in e&&e.id!==t.id}function uP(e,t){var n=e.businessObject,i=im(e);R(t,function(e,t){var r;"di"!==t?n.set(t,e):i&&(r=i,R(e,function(e,t){r.set(t,e)}))})}uC.$inject=["elementRegistry","moddle","modeling","textRenderer"],uC.prototype.execute=function(e){var t,n,i,r,o,a,s,c=e.element,l=[c];if(!c)throw Error("element required");var p=this._elementRegistry,u=this._moddle.ids,h=c.businessObject,d=(n=G({},t=e.properties),uA.forEach(function(e){e in t&&(n[e]=id(n[e]))}),n),f=e.oldProperties||(i=c,o=B(r=d),a=i.businessObject,s=im(i),P(o,function(e,t){var n;return"di"!==t?e[t]=a.get(t):e[t]=(n=s,P(B(r.di),function(e,t){return e[t]=n&&n.get(t),e},{})),e},{}));return uR(d,h)&&(u.unclaim(h.id),p.updateId(c,d.id),u.claim(d.id,h)),uS in d&&(d[uS]&&l.push(p.get(d[uS].id)),h[uS]&&l.push(p.get(h[uS].id))),uP(c,d),e.oldProperties=f,e.changed=l,l},uC.prototype.postExecute=function(e){var t=e.element.label,n=t&&id(t).name;if(n){var i=this._textRenderer.getExternalLabelBounds(t,n);this._modeling.resizeShape(t,i,uk)}},uC.prototype.revert=function(e){var t=e.element,n=e.properties,i=e.oldProperties,r=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return uP(t,i),uR(n,r)&&(a.unclaim(n.id),o.updateId(t,i.id),a.claim(i.id,r)),e.changed};var uA=["default"];function uM(e,t){this._canvas=e,this._modeling=t}function uT(e,t){this._modeling=e,this._spaceTool=t}function uB(e){this._modeling=e}function uD(e,t){this._modeling=e,this._spaceTool=t}uM.$inject=["canvas","modeling"],uM.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,a=o.$parent,s=im(r);return t.setRootElement(n),t.removeRootElement(r),e7(a.rootElements,i),i.$parent=a,e8(a.rootElements,o),o.$parent=null,r.di=null,s.bpmnElement=i,n.di=s,e.oldRoot=r,[]},uM.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=e.oldRoot,o=r.businessObject,a=i.$parent,s=im(n);return t.setRootElement(r),t.removeRootElement(n),e8(a.rootElements,i),i.$parent=null,e7(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,r.di=s,[]},uT.$inject=["modeling","spaceTool"],uT.prototype.preExecute=function(e){var t,n,i,r,o,a=this._spaceTool,s=this._modeling,c=e.shape,l=e.location,p=sq(c),u=p===c,h=u?c:c.parent,d=sU(h),f=iM(c);if(f?"left"===l?l="top":"right"===l&&(l="bottom"):"top"===l?l="left":"bottom"===l&&(l="right"),!d.length){var m=f?{x:c.x+30,y:c.y,width:c.width-30,height:c.height}:{x:c.x,y:c.y+30,width:c.width,height:c.height-30};s.createShape({type:"bpmn:Lane",isHorizontal:f},m,h)}var g=[];eQ(p,function(e){return(g.push(e),e.label&&g.push(e.label),e===c)?[]:C(e.children,function(e){return e!==c})}),"top"===l?(t=-120,i=(n=c.y)+10,r="n",o="y"):"left"===l?(t=-120,i=(n=c.x)+10,r="w",o="x"):"bottom"===l?(t=120,i=(n=c.y+c.height)-10,r="s",o="y"):"right"===l&&(t=120,i=(n=c.x+c.width)-10,r="e",o="x");var y=a.calculateAdjustments(g,o,t,i),v=f?{x:0,y:t}:{x:t,y:0};a.makeSpace(y.movingShapes,y.resizingShapes,v,r,i);var b=f?{x:c.x+30*!!u,y:n-120*("top"===l),width:c.width-30*!!u,height:120}:{x:n-120*("left"===l),y:c.y+30*!!u,width:120,height:c.height-30*!!u};e.newLane=s.createShape({type:"bpmn:Lane",isHorizontal:f},b,h)},uB.$inject=["modeling"],uB.prototype.preExecute=function(e){var t,n,i,r,o=this._modeling,a=e.shape,s=e.count,c=sU(a),l=c.length;if(l>s)throw Error(`more than <${s}> child lanes`);var p=iM(a),u=p?a.height:a.width,h=Math.round(u/s);for(r=0;r<s;r++)t=r===s-1?u-h*r:h,n=p?{x:a.x+30,y:a.y+r*h,width:a.width-30,height:t}:{x:a.x+r*h,y:a.y+30,width:t,height:a.height-30},r<l?o.resizeShape(c[r],n):(i={type:"bpmn:Lane",isHorizontal:p},o.createShape(i,n,a))},uD.$inject=["modeling","spaceTool"],uD.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds;!1!==e.balanced?this.resizeBalanced(t,n):this.resizeSpace(t,n)},uD.prototype.resizeBalanced=function(e,t){var n,i,r,o,a,s,c,l,p=this._modeling,u=(i=iu(n=sq(e),"bpmn:Process")?[]:[n],r=sW(n,i),o=tD(e),a=tD(t),s=s$(tD(t),tD(e)),c=[],l=iM(e),r.forEach(function(t){if(t!==e){var n,i=l?0:s.top,r=l?s.right:0,p=l?0:s.bottom,u=l?s.left:0,h=tD(t);
354s.top&&(10>sV(h.bottom-o.top)&&(p=a.top-h.bottom),5>sV(h.top-o.top)&&(i=a.top-h.top)),s.left&&(10>sV(h.right-o.left)&&(r=a.left-h.right),5>sV(h.left-o.left)&&(u=a.left-h.left)),s.bottom&&(10>sV(h.top-o.bottom)&&(i=a.bottom-h.top),5>sV(h.bottom-o.bottom)&&(p=a.bottom-h.bottom)),s.right&&(10>sV(h.left-o.right)&&(u=a.right-h.left),5>sV(h.right-o.right)&&(r=a.right-h.right)),(i||r||p||u)&&c.push({shape:t,newBounds:(n={top:i,right:r,bottom:p,left:u},{x:t.x+(n.left||0),y:t.y+(n.top||0),width:t.width-(n.left||0)+(n.right||0),height:t.height-(n.top||0)+(n.bottom||0)})})}}),c);p.resizeShape(e,t),u.forEach(function(e){p.resizeShape(e.shape,e.newBounds)})},uD.prototype.resizeSpace=function(e,t){var n,i,r,o,a,s=this._spaceTool,c=tD(e),l=s$(tD(t),c),p=sq(e),u=[],h=[];eQ(p,function(e){return u.push(e),(iu(e,"bpmn:Lane")||iu(e,"bpmn:Participant"))&&h.push(e),e.children}),(l.bottom||l.top)&&(n=l.bottom||l.top,i=e.y+(l.bottom?e.height:0)+(l.bottom?-10:10),r=l.bottom?"s":"n",o=l.top>0||l.bottom<0?-n:n,a=s.calculateAdjustments(u,"y",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:0,y:n},r)),(l.left||l.right)&&(n=l.right||l.left,i=e.x+(l.right?e.width:0)+(l.right?-10:100),r=l.right?"e":"w",o=l.left>0||l.right<0?-n:n,a=s.calculateAdjustments(h,"x",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:n,y:0},r))};var uj="flowNodeRef",uO="lanes";function uN(){}uN.prototype._computeUpdates=function(e,t){var n=[],i=[],r={},o=[];function a(e){-1===n.indexOf(e)&&(o.push(e),n.push(e))}return t.forEach(function(e){var t=sq(e);t&&-1===n.indexOf(t)&&(t.children.filter(function(e){return iu(e,"bpmn:FlowNode")}).forEach(a),n.push(t))}),e.forEach(a),o.forEach(function(e){var t,n,o=e.businessObject,a=o.get(uO).slice(),s=(t=e).parent?(!r[(n=sq(t)).id]&&(r[n.id]=sW(n)),r[n.id]).filter(function(e){var n,i;return n=tD(e),(i={x:t.x+t.width/2,y:t.y+t.height/2}).x>n.left&&i.x<n.right&&i.y>n.top&&i.y<n.bottom}).map(function(e){return e.businessObject}):[];i.push({flowNode:o,remove:a,add:s})}),t.forEach(function(e){var t=e.businessObject;e.parent||t.get(uj).forEach(function(e){i.push({flowNode:e,remove:[t],add:[]})})}),i},uN.prototype.execute=function(e){var t=e.updates;return t||(t=e.updates=this._computeUpdates(e.flowNodeShapes,e.laneShapes)),t.forEach(function(e){var t=e.flowNode,n=t.get(uO);e.remove.forEach(function(e){e8(n,e),e8(e.get(uj),t)}),e.add.forEach(function(e){e7(n,e),e7(e.get(uj),t)})}),[]},uN.prototype.revert=function(e){return e.updates.forEach(function(e){var t=e.flowNode,n=t.get(uO);e.add.forEach(function(e){e8(n,e),e8(e.get(uj),t)}),e.remove.forEach(function(e){e7(n,e),e7(e.get(uj),t)})}),[]};var uL="categoryValueRef";function u$(e,t){this._bpmnFactory=e,this._elementRegistry=t}function uI(e){for(;e.parent;)e=e.parent;return e}function uF(e){this._moddle=e}u$.$inject=["bpmnFactory","elementRegistry"],u$.prototype._computeUpdates=function(e,t){var n=this._elementRegistry,i=this._bpmnFactory,r=new Map,o=[],a=new Map;function s(e,t,n){if(t){var i=a.get(e);i||(i={},a.set(e,i)),n&&i.present||(n||!i.past)&&(n?i.present={categoryValue:t,root:uI(e)}:i.past={categoryValue:t})}}function c(e){r.set(e,id(e))}function l(){n.filter(function(e){return iu(e,"bpmn:FlowElement")&&!tM(e)&&e.parent}).forEach(c)}function p(e){return e.reduce(function(e,t){var n=uI(t),i=e.get(n);return i||(i=[],e.set(n,i)),i.push(t),e},new Map)}var u=p(e=Array.from(e||[]));t.length&&l(),e.forEach(c),n.filter(function(e){return iu(e,"bpmn:Group")&&!tM(e)&&e.parent}).forEach(function(e){var t=id(e).get("categoryValueRef");if(!t){var n,r,a,c=uI(e);Object.keys(e5(u.get(c)||[],e)).length>0&&((a=(r=id(e)).get("categoryValueRef"))||(a=sx(i,r),o.push({groupShape:e,categoryValue:n=a,category:n.$parent})),t=a)}s(e,t,!0)}),t.forEach(function(e){s(e.groupShape,e.categoryValue,!1)}),o.length&&l();var h=Array.from(r.keys()),d=Array.from(a.values()).reduce(function(e,t){return t.present&&e.add(t.present.categoryValue),t.past&&e.add(t.past.categoryValue),e},new Set),f=new Map,m=p(h);return a.forEach(function(e,t){var n=e.present;if(n){var i=m.get(n.root)||[],r=e5(i,t);i.forEach(function(e){if(r[e.id]){var t=f.get(e);t||(t=new Set,f.set(e,t)),t.add(n.categoryValue)}})}}),{flowElements:h.reduce(function(e,t){var n=r.get(t),i=n.get(uL),o=new Set(i),a=f.get(t)||new Set,s=Array.from(a).filter(function(e){return!o.has(e)}),c=i.filter(function(e){return d.has(e)&&!a.has(e)});return(s.length||c.length)&&e.push({businessObject:n,categoryValuesToAdd:s,categoryValuesToRemove:c}),e},[]),groups:o}},u$.prototype.execute=function(e){var t=e.updates;return t||(t=e.updates=this._computeUpdates(e.affectedFlowElements,e.affectedGroupEntries)),t.groups.forEach(function(e){id(e.groupShape).categoryValueRef=e.categoryValue,e.categoryValue.$parent=e.category}
354),t.flowElements.forEach(function(e){var t=e.businessObject.get(uL);e.categoryValuesToRemove.forEach(function(e){e8(t,e)}),e.categoryValuesToAdd.forEach(function(e){e7(t,e,!0)})}),[]},u$.prototype.revert=function(e){var t=e.updates;return t.flowElements.forEach(function(e){var t=e.businessObject.get(uL);e.categoryValuesToAdd.forEach(function(e){e8(t,e)}),e.categoryValuesToRemove.forEach(function(e){e7(t,e,!0)})}),t.groups.forEach(function(e){id(e.groupShape).categoryValueRef=null}),[]},uF.$inject=["moddle"],uF.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,i=e.element;return e.claiming?t.claim(n,i):t.unclaim(n),[]},uF.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,i=e.element;return e.claiming?t.unclaim(n):t.claim(n,i),[]};var uz={fill:void 0,stroke:void 0};function uH(e){this._commandStack=e,this._normalizeColor=function(e){if(e){if(w(e)){var t,n,i=(t=e,(n=document.createElement("canvas").getContext("2d")).fillStyle="transparent",n.fillStyle=t,/^#[0-9a-fA-F]{6}$/.test(n.fillStyle)?n.fillStyle:null);if(i)return i}throw Error(`invalid color value: ${e}`)}}}uH.$inject=["commandStack"],uH.prototype.postExecute=function(e){var t=e.elements,n=e.colors||uz,i=this,r={};"fill"in n&&G(r,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&G(r,{"border-color":this._normalizeColor(n.stroke)}),R(t,function(e){var t,n=tA(e)?W(r,["border-color"]):r,o=im(e);if("border-color"in(t=n)&&(t.stroke=t["border-color"]),"background-color"in t&&(t.fill=t["background-color"]),tM(e)){if(!o||!iu(o.label,"bpmndi:BPMNLabel"))return;i._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:o.label,properties:{color:r["border-color"]}})}else{if(!ih(o,["bpmndi:BPMNEdge","bpmndi:BPMNShape"]))return;i._commandStack.execute("element.updateProperties",{element:e,properties:{di:n}})}})};var uV={width:0,height:0};function uG(e,t,n){function i(e,t){var n=e.label||e,i=e.labelTarget||e;return!function(e,t){var n=e.businessObject,i=iL(n);if(i)if("categoryValueRef"===i){if(!n[i])return;n[i].value=t}else n[i]=t}(n,t),[n,i]}this.preExecute=function(t){var n=t.element,i=n.businessObject,r=t.newLabel;if(!tM(n)&&ij(n)&&!iO(n)&&!uW(r)){var o=iN(n);o={x:o.x,y:o.y+7},e.createLabel(n,o,{id:i.id+"_label",businessObject:i,di:n.di})}},this.execute=function(e){return e.oldLabel=i$(e.element),i(e.element,e.newLabel)},this.revert=function(e){return i(e.element,e.oldLabel)},this.postExecute=function(n){var i=n.element,r=i.label||i,o=n.newLabel,a=n.newBounds,s=n.hints||{};if(tM(r)||iu(r,"bpmn:TextAnnotation")){if(tM(r)&&uW(o)){!1!==s.removeShape&&e.removeShape(r,{unsetLabel:!1});return}var c=i$(i);void 0===a&&(a=t.getExternalLabelBounds(r,c)),a&&e.resizeShape(r,a,uV)}}}function uW(e){return!e||!e.trim()}function uU(e,t,n,i){ux.call(this,e,t,n),this._bpmnRules=i}function uq(){}uG.$inject=["modeling","textRenderer","bpmnFactory"],i(uU,ux),uU.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],uU.prototype.getHandlers=function(){var e=ux.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=uw,e["element.updateProperties"]=uC,e["canvas.updateRoot"]=uM,e["lane.add"]=uT,e["lane.resize"]=uD,e["lane.split"]=uB,e["lane.updateRefs"]=uN,e["group.updateRefs"]=u$,e["id.updateClaim"]=uF,e["element.setColor"]=uH,e["element.updateLabel"]=uG,e},uU.prototype.updateLabel=function(e,t,n,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:i||{}})},uU.prototype.connect=function(e,t,n,i){var r=this._bpmnRules;if(n||(n=r.canConnect(e,t)),n)return this.createConnection(e,t,n,e.parent,i)},uU.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},uU.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},uU.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},uU.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane},uU.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},uU.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"});return this._commandStack.execute("canvas.updateRoot",{newRoot:e}),e},uU.prototype.makeProcess=function(){var e=this._create("root",{type:"bpmn:Process"});return this._commandStack.execute("canvas.updateRoot",{newRoot:e}),e},uU.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},uU.prototype.updateCategoryValueRefs=function(e,t){this._commandStack.execute("group.updateRefs",{affectedFlowElements:e,affectedGroupEntries:t})},uU.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},uU.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},uU.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})},uq.prototype.layoutConnection=function(e,t){return[(t=t||{}).connectionStart||tO(t.source||e.source),t.connectionEnd||tO(t.target||e.target)]};var uK=Math.round,uY={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function uX(e,t,n){var i,r,o=tN(t,e,5),a=n.split(":")[0],s=uK((t.x-e.x)/2+e.x),c=uK((t.y-e.y)/2+e.y),l=({t:
354/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/})[a].test(o),p=/h|r|l/.test(a),u=!1,h=!1;return l?(i=p?{x:s,y:e.y}:{x:e.x,y:c},r=p?"h:h":"v:v"):(u=!({t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./})[a].test(o),r=p?"h:v":"v:h",u?p?(h=c===e.y,i={x:e.x+20*(/l/.test(a)?-1:1),y:h?c+20:c}):i={x:(h=s===e.x)?s+20:s,y:e.y+20*(/t/.test(a)?-1:1)}:i={x:s,y:c}),{waypoints:uJ(e,i,r).concat(i),directions:r,turnNextDirections:h}}function uZ(e){return e.split(":").reverse().join(":")}function uJ(e,t,n){if(i=n=n||"h:h",!/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(i))throw Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(u1(n)){var i,r,o,a,s,c=uX(e,t,n),l={waypoints:(r=uX(t,e,uZ(n))).waypoints.slice().reverse(),directions:uZ(r.directions),turnNextDirections:r.turnNextDirections},p=(o=c.directions.split(":")[1],a=l.directions.split(":")[0],c.turnNextDirections&&(o="h"==o?"v":"h"),l.turnNextDirections&&(a="h"==a?"v":"h"),s=o+":"+a,{waypoints:uJ(c.waypoints[c.waypoints.length-1],l.waypoints[0],s),directions:s});return[].concat(c.waypoints,p.waypoints,l.waypoints)}var u=n,h=uK((t.x-e.x)/2+e.x),d=uK((t.y-e.y)/2+e.y);if("h:v"===u)return[{x:t.x,y:e.y}];if("v:h"===u)return[{x:e.x,y:t.y}];if("h:h"===u)return[{x:h,y:e.y},{x:h,y:t.y}];if("v:v"===u)return[{x:e.x,y:d},{x:t.x,y:d}];throw Error("invalid directions: can only handle varians of [hv]:[hv]")}function uQ(e,t,n){var i,r,o;return i=t[e],r=n[e],o=n[e]+n[({x:"width",y:"height"})[e]],i>=r&&i<=o}function u0(e,t,n,i){if(i.length<3||!(i.length>4)&&S(i,function(e,t){var n=i[t-1];return n&&3>tt(e,n)}))return null;var r,o=i[0],a=i.slice();return(a[0]=n,a[1]=function(e,t,n){switch(ti(t,e)){case"v":return{x:n.x,y:e.y};case"h":return{x:e.x,y:n.y}}return{x:e.x,y:e.y}}(a[1],o,n),(r=function(e,t,n){var i;for(i=e.length-2;0!==i;i--)if(tr(e[i],t,20)||tr(e[i],n,20))return e.slice(i);return e}(a,e,t))!==a&&(a=u0(e,t,n,r)),a&&ti(a))?null:a}function u1(e){return e&&/t|r|b|l/.test(e)}function u2(e,t,n,i){if("h"===n&&(n=/left/.test(i)?"l":"r"),"v"===n&&(n=/top/.test(i)?"t":"b"),"t"===n)return{original:e,x:e.x,y:t.y};if("r"===n)return{original:e,x:t.x+t.width,y:e.y};if("b"===n)return{original:e,x:e.x,y:t.y+t.height};if("l"===n)return{original:e,x:t.x,y:e.y};throw Error("unexpected dockingDirection: <"+n+">")}function u5(e){return e.reduce(function(t,n,i){return tn(t[t.length-1],e[i+1],n,0)||t.push(n),t},[])}var u3={default:["h:h"],fromGateway:["v:h"],toGateway:["h:v"],loop:{fromTop:["t:r"],fromRight:["r:b"],fromLeft:["l:t"],fromBottom:["b:l"]},boundaryLoop:{alternateHorizontalSide:"b",alternateVerticalSide:"l",default:"v"},messageFlow:["straight","v:v"],subProcess:["straight","h:h"],isHorizontal:!0},u6={default:["v:v"],fromGateway:["h:v"],toGateway:["v:h"],loop:{fromTop:["t:l"],fromRight:["r:t"],fromLeft:["l:b"],fromBottom:["b:r"]},boundaryLoop:{alternateHorizontalSide:"t",alternateVerticalSide:"r",default:"h"},messageFlow:["straight","h:h"],subProcess:["straight","v:v"],isHorizontal:!1},u9={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},u4={top:"t",right:"r",bottom:"b",left:"l"};function u8(e){this._elementRegistry=e}function u7(e,t){return e?e.original||e:tO(t)}function he(e,t){return iu(t,"bpmn:Activity")&&iu(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function ht(e){return iu(e,"bpmn:SubProcess")&&iA(e)}i(u8,uq),u8.prototype.layoutConnection=function(e,t){t||(t={});var n,i,r,o,a,s,c,l,p,u,h,d=t.source||e.source,f=t.target||e.target,g=t.waypoints||e.waypoints,y=t.connectionStart,b=t.connectionEnd,_=this._elementRegistry;if(y||(y=u7(g&&g[0],d)),b||(b=u7(g&&g[g.length-1],f)),(iu(e,"bpmn:Association")||iu(e,"bpmn:DataAssociation"))&&g&&!he(d,f))return[].concat([y],g.slice(1,-1),[b]);var x=ae(d,_)?u3:u6;return iu(e,"bpmn:MessageFlow")?(n=d,i=f,u={preferredLayouts:x.messageFlow,preserveDocking:(r=n,iu(o=i,"bpmn:Participant")?"source":iu(r,"bpmn:Participant")?"target":ht(o)?"source":ht(r)||iu(o,"bpmn:Event")?"target":iu(r,"bpmn:Event")?"source":null)}
354):(iu(e,"bpmn:SequenceFlow")||he(d,f))&&(u=d===f?{preferredLayouts:(a=d,s=e,c=x,"top"===(p=(l=s.waypoints)&&l.length&&tN(l[0],a))?c.loop.fromTop:"right"===p?c.loop.fromRight:"left"===p?c.loop.fromLeft:c.loop.fromBottom)}:iu(d,"bpmn:BoundaryEvent")?{preferredLayouts:function(e,t,n,i){var r,o,a,s,c,l,p,u=tO(e),h=tO(t),d=(p=e.host,tN(tO(e),p,-10)),f=e.host===t,m=-1!==["top","right","bottom","left"].indexOf(d),g=tN(h,u,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return f?(r=d,o=m,a=e,s=t,c=n,l=i,[u4[o?r:l.isHorizontal?hi(r):hn(r)]+":"+(o?hr(r)?ho("y",a,s,c)?"h":l.boundaryLoop.alternateHorizontalSide:ho("x",a,s,c)?"v":l.boundaryLoop.alternateVerticalSide:l.boundaryLoop.default)]):[function(e,t,n,i){if(n)return u4[e];var r=hi(e),o=hn(e),a=hi(t),s=hn(t);if(i){if(r===a||u9[o]===s)return u4[r]}else if(o===s||u9[r]===a)return u4[o];return u4[i?o:r]}(d,g,m,i.isHorizontal)+":"+function(e,t,n,i){if(n)if(hr(e))return(r=u9[hn(e)],-1!==t.indexOf(r)||e===t)?"h":"v";else return(o=u9[hi(e)],-1!==t.indexOf(o)||e===t)?"v":"h";var r,o,a=hi(e),s=hn(e),c=hi(t),l=hn(t);if(c&&!l)return"v";if(l&&!c)return"h";if(i)if(a===c)return"h";else return"v";return s===l?"v":"h"}(d,g,m,i.isHorizontal)]}(d,f,b,x)}:ht(d)||ht(f)?{preferredLayouts:x.subProcess,preserveDocking:ht(d)?"target":"source"}:iu(d,"bpmn:Gateway")?{preferredLayouts:x.fromGateway}:iu(f,"bpmn:Gateway")?{preferredLayouts:x.toGateway}:{preferredLayouts:x.default}),u&&(h=u5(function(e,t,n,i,r,o){var a,s,c,l,p,u,h,d,f,g,y,b,_,x,w,E,S,k,C,R;if(v(n)&&(r=n,o=i,n=tO(e),i=tO(t)),o=G({preferredLayouts:[]},o),r=r||[],(a=-1!==o.preferredLayouts.indexOf("straight")&&(b=e,_=t,x=n,w=i,E=o,C={},(k=tN(b,_),/^(top|bottom|left|right)$/.test(k))?(/top|bottom/.test(k)&&(S="x"),/left|right/.test(k)&&(S="y"),"target"===E.preserveDocking)?uQ(S,w,b)?(C[S]=w[S],[{x:void 0!==C.x?C.x:x.x,y:void 0!==C.y?C.y:x.y,original:{x:void 0!==C.x?C.x:x.x,y:void 0!==C.y?C.y:x.y}},{x:w.x,y:w.y}]):null:uQ(S,x,_)?(C[S]=x[S],[{x:x.x,y:x.y},{x:void 0!==C.x?C.x:w.x,y:void 0!==C.y?C.y:w.y,original:{x:void 0!==C.x?C.x:w.x,y:void 0!==C.y?C.y:w.y}}
354]):null:null))||(a=o.connectionEnd&&((R=u0(t,e,i,R=r.slice().reverse()))?R.reverse():null))||(a=o.connectionStart&&u0(e,t,n,r)))return a;if(!o.connectionStart&&!o.connectionEnd&&r&&r.length)return r;return s=n,c=i,h=function(e,t){if(u1(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}(u=tN(e,t,uY[p=function(e,t){if(m(e))return[];if(!v(e))throw Error("must supply array");let n=I(t);return e.filter(function(e,t){return!n(e,t)})}((l=o)&&l.preferredLayouts||[],"straight")[0]||"h:h"]||0),p),s=s||tO(e),c=c||tO(t),f=u2(s,e,(d=h.split(":"))[0],{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[u]),(y=uJ(f,g=u2(c,t,d[1],u),h)).unshift(f),y.push(g),u5(y)}(d,f,y,b,g,u=G(u,t)))),h||[y,b]};function hn(e){var t=/right|left/.exec(e);return t&&t[0]}function hi(e){var t=/top|bottom/.exec(e);return t&&t[0]}function hr(e){return"right"===e||"left"===e}function ho(e,t,n,i){return!(ha(e,i,n,40)||ha(e,i,{x:n.x+n.width,y:n.y+n.height},40)||ha(e,i,tO(t),40))}function ha(e,t,n,i){return Math.abs(t[e]-n[e])<i}function hs(e){return G({original:e.point.original||e.point},e.actual)}function hc(e,t){this._elementRegistry=e,this._graphicsFactory=t}u8.$inject=["elementRegistry"],hc.$inject=["elementRegistry","graphicsFactory"],hc.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;var i=this.getDockingPoint(e,t,!0),r=this.getDockingPoint(e,n),o=e.waypoints.slice(i.idx+1,r.idx);return o.unshift(hs(i)),o.push(hs(r)),o},hc.prototype.getDockingPoint=function(e,t,n){var i,r,o=e.waypoints;return i=n?0:o.length-1,{point:r=o[i],actual:this._getIntersection(t,e,n)||r,idx:i}},hc.prototype._getIntersection=function(e,t,n){return tL(this._getShapePath(e),this._getConnectionPath(t),n)},hc.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},hc.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},hc.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};let hl={__init__:["modeling","bpmnUpdater"],__depends__:[{__init__:["adaptiveLabelPositioningBehavior","appendBehavior","artifactBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","categoryRootElementReferenceBehavior","compensateBoundaryEventBehaviour","createBehavior","createDataObjectBehavior","createParticipantBehavior","dataInputAssociationBehavior","dataStoreBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","fixHoverBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","layoutConnectionBehavior","messageFlowBehavior","nonInterruptingBehavior","removeElementBehavior","removeEmbeddedLabelBoundsBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","rootElementReferenceBehavior","spaceToolBehavior","subProcessPlaneBehavior","subProcessStartEventBehavior","textAnnotationBehavior","toggleCollapseConnectionBehaviour","toggleElementCollapseBehaviour","unclaimIdBehavior","updateFlowNodeRefsBehavior","updateCategoryValueRefsBehavior","unsetDefaultFlowBehavior","setCompensationActivityAfterPasteBehavior"],adaptiveLabelPositioningBehavior:["type",sd],appendBehavior:["type",sf],associationBehavior:["type",sg],attachEventBehavior:["type",sy],artifactBehavior:["type",sm],boundaryEventBehavior:["type",sb],categoryRootElementReferenceBehavior:["type",sw],compensateBoundaryEventBehaviour:["type",sS],createBehavior:["type",sP],createDataObjectBehavior:["type",sA],createParticipantBehavior:["type",sM],dataInputAssociationBehavior:["type",sB],dataStoreBehavior:["type",sO],deleteLaneBehavior:["type",sK],detachEventBehavior:["type",sY],dropOnFlowBehavior:["type",sZ],eventBasedGatewayBehavior:["type",sQ],fixHoverBehavior:["type",s1],groupBehavior:["type",s2],importDockingFix:["type",s3],isHorizontalFix:["type",s9],labelBehavior:["type",cf],layoutConnectionBehavior:["type",cm],messageFlowBehavior:["type",cS],nonInterruptingBehavior:["type",cP],removeElementBehavior:["type",cM],removeEmbeddedLabelBoundsBehavior:["type",cA],removeParticipantBehavior:["type",cB],replaceConnectionBehavior:["type",cD],replaceElementBehaviour:["type",cj],resizeBehavior:["type",cH],resizeLaneBehavior:["type",cY],rootElementReferenceBehavior:["type",cX
vendor: 20,651 bytes, lines 354-355
354],spaceToolBehavior:["type",cJ],subProcessPlaneBehavior:["type",c0],subProcessStartEventBehavior:["type",c2],textAnnotationBehavior:["type",c5],toggleCollapseConnectionBehaviour:["type",c3],toggleElementCollapseBehaviour:["type",c6],unclaimIdBehavior:["type",c9],unsetDefaultFlowBehavior:["type",c4],updateFlowNodeRefsBehavior:["type",le],updateCategoryValueRefsBehavior:["type",lr],setCompensationActivityAfterPasteBehavior:["type",la]},{__depends__:[ay],__init__:["bpmnRules"],bpmnRules:["type",lc]},{__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",lF]},{__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",lH]},ps,{commandStack:["type",pk]},{__init__:["labelSupport"],labelSupport:["type",pR]},{__depends__:[ay],__init__:["attachSupport"],attachSupport:["type",pM]},rG,rl,pS],bpmnFactory:["type",pB],bpmnUpdater:["type",pD],elementFactory:["type",pX],modeling:["type",uU],layouter:["type",u8],connectionDocking:["type",hc]},hp=Math.round;function hu(e,t,n,i,r,o){this._complexPreview=e,this._connectionDocking=t,this._elementFactory=n,this._eventBus=i,this._layouter=r,this._rules=o}hu.prototype.create=function(e,t,n){let i=this._complexPreview,r=this._connectionDocking,o=this._elementFactory,a=this._eventBus,s=this._layouter,c=this._rules,l=o.createShape(G({type:t},n)),p=a.fire("autoPlace",{source:e,shape:l});if(!p)return;G(l,{x:p.x-hp(l.width/2),y:p.y-hp(l.height/2)});let u=c.allowed("connection.create",{source:e,target:l,hints:{targetParent:e.parent}}),h=null;u&&((h=o.createConnection(u)).waypoints=s.layoutConnection(h,{source:e,target:l}),h.waypoints=r.getCroppedWaypoints(h,e,l)),i.create({created:[l,h].filter(e=>!y(e))})},hu.prototype.cleanUp=function(){this._complexPreview.cleanUp()},hu.$inject=["complexPreview","connectionDocking","elementFactory","eventBus","layouter","rules"];var hh=Math.min,hd=Math.max;function hf(e){e.preventDefault()}function hm(e){e.stopPropagation()}function hg(e){this.container=e.container,this.parent=eu('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=es("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.focusoutHandler=e.focusoutHandler||function(){},this.autoResize=V(this.autoResize,this),this.handlePaste=V(this.handlePaste,this)}function hy(e,t){this._eventBus=e,this._canvas=t,this._providers=[],this._textbox=new hg({container:t.getContainer(),keyHandler:V(this._handleKey,this),resizeHandler:V(this._handleResize,this),focusoutHandler:V(this._handleFocusout,this)}),e.on(["diagram.clear","diagram.destroy"],()=>this._cleanup())}hg.prototype.create=function(e,t,n,i){var r=this.parent,o=this.content,a=this.container;i=this.options=i||{};var s=W(t=this.style=t||{},["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);G(r.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},s);var c=W(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return G(o.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},c),i.centerVertically&&G(o.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},c),o.innerText=n,en.bind(o,"keydown",this.keyHandler),en.bind(o,"mousedown",hm),en.bind(o,"paste",this.handlePaste),en.bind(o,"focusout",this.focusoutHandler),i.autoResize&&en.bind(o,"input",this.autoResize),i.resizable&&this.resizable(t),a.appendChild(r),this.setSelection(o.lastChild,o.lastChild&&o.lastChild.length),r},hg.prototype.handlePaste=function(e){var t,n=this.options,i=this.style;if(e.preventDefault(),t=e.clipboardData?e.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(t),n.autoResize){var r=this.autoResize(i);r&&this.resizeHandler(r)}},hg.prototype.insertText=function(e){e=e.replace(/\r\n|\r|\n/g,` 355`),document.execCommand("insertText",!1,e)||this._insertTextIE(e)},hg.prototype._insertTextIE=function(e){var t,n,i,r=this.getSelection(),o=r.startContainer,a=r.endContainer,s=r.startOffset,c=r.endOffset,l=r.commonAncestorContainer,p=(t=l.childNodes,[].slice.call(t));if(l.nodeType===Node.TEXT_NODE){var u=o.textContent;o.textContent=u.substring(0,s)+e+u.substring(c),n=o,i=s+e.length}else if(o===this.content&&a===this.content){var h=document.createTextNode(e);this.content.insertBefore(h,p[s]),n=h,i=h.textContent.length}else{var d=p.indexOf(o),f=p.indexOf(a);p.forEach(function(t,n){n===d?t.textContent=o.textContent.substring(0,s)+e+a.textContent.substring(c):n>d&&n<=f&&el(t)}),n=o,i=s+e.length}n&&void 0!==i&&setTimeout(function(){self.setSelection(n,i)})},hg.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight<e.offsetHeight-n){var i=e.getBoundingClientRect(),r=t.scrollHeight;e.style.height=r+"px",this.resizeHandler({width:i.width,height:i.height,dx:0,dy:r-i.height})}},hg.prototype.resizable=function(){var e=this,t=this.parent,n=this.resizeHandle,i=parseInt(this.style.minWidth)||0,r=parseInt(this.style.minHeight)||0,o=parseInt(this.style.maxWidth)||1/0,a=parseInt(this.style.maxHeight)||1/0;if(!n){n=this.resizeHandle=eu('<div class="djs-direct-editing-resize-handle"></div>');var s,c,l,p,u=function(n){hf(n),hm(n);var u=hh(hd(l+n.clientX-s,i),o),h=hh(hd(p+n.clientY-c,r),a);t.style.width=u+"px",t.style.height=h+"px",e.resizeHandler({width:l,height:p,dx:n.clientX-s,dy:n.clientY-c})},h=function(e){hf(e),hm(e),en.unbind(document,"mousemove",u,!1),en.unbind(document,"mouseup",h,!1)};en.bind(n,"mousedown",function(e){hf(e),hm(e),s=e.clientX,c=e.clientY;var n=t.getBoundingClientRect();l=n.width,p=n.height,en.bind(document,"mousemove",u),en.bind(document,"mouseup",h)})}G(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)},hg.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),en.unbind(t,"keydown",this.keyHandler),en.unbind(t,"mousedown",hm),en.unbind(t,"input",this.autoResize),en.unbind(t,"paste",this.handlePaste),en.unbind(t,"focusout",this.focusoutHandler),n&&(n.removeAttribute("style"),el(n)),el(e)},hg.prototype.getValue=function(){return this.content.innerText.trim()},hg.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},hg.prototype.setSelection=function(e,t){var n=document.createRange();null===e?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)},hy.$inject=["eventBus","canvas"],hy.prototype.registerProvider=function(e){this._providers.push(e)},hy.prototype.isActive=function(e){return!!(this._active&&(!e||this._active.element===e))},hy.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},hy.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},hy.prototype.close=function(){this._fire("deactivate"),this._cleanup(),this._canvas.restoreFocus&&this._canvas.restoreFocus()},hy.prototype._cleanup=function(){this._active&&(this._textbox.destroy(),this._active=null,this.resizable=void 0)},hy.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue();(r!==e.context.text||i.height!==n.height||i.width!==n.width)&&(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,r,e.context.text,{x:i.left-t.left,y:i.top-t.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},hy.prototype.getValue=function(){return this._textbox.getValue()},hy.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;return 27===t?(e.preventDefault(),this.cancel()):13!==t||e.shiftKey?void 0:(e.preventDefault(),this.complete())},hy.prototype._handleResize=function(e){this._fire("resize",e)},hy.prototype._handleFocusout=function(e){e.relatedTarget&&this._textbox.parent.contains(e.relatedTarget)||this.complete()},hy.prototype.activate=function(e){if(this.isActive()&&this.cancel(),!1===this._eventBus.fire("directEditing.activate.allowed",{element:e}))return!1;var t,n=S(this._providers,function(n){return(t=n.activate(e))?n:null});return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};let hv={__depends__:[rL],__init__:["directEditing"],directEditing:["type",hy]},hb={task:{label:"Task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},"user-task":{label:"User task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},"service-task":{label:"Service task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},"send-task":{label:"Send task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},"receive-task":{label:"Receive task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},"manual-task":{label:"Manual task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},"rule-task":{label:"Business rule task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},"script-task":{label:"Script task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},"call-activity":{label:"Call activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},transaction:{label:"Transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},"event-subprocess":{label:"Event sub-process",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},"collapsed-subprocess":{label:"Sub-process (collapsed)",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},"expanded-subprocess":{label:"Sub-process (expanded)",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},"collapsed-ad-hoc-subprocess":{label:"Ad-hoc sub-process (collapsed)",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}},"expanded-ad-hoc-subprocess":{label:"Ad-hoc sub-process (expanded)",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},"exclusive-gateway":{label:"Exclusive gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},"parallel-gateway":{label:"Parallel gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},"inclusive-gateway":{label:"Inclusive gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},"complex-gateway":{label:"Complex gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},"event-based-gateway":{label:"Event-based gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}},"data-store-reference":{label:"Data store reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}},"data-object-reference":{label:"Data object reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}},"expanded-pool":{label:"Expanded pool/participant",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},"collapsed-pool":{label:"Empty pool/participant",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}},"none-start-event":{label:"Start event",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},"none-intermediate-throwing":{label:"Intermediate throw event",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},"none-boundary-event":{label:"Boundary event",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:BoundaryEvent"}},"none-end-event":{label:"End event",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},"message-start":{label:"Message start event",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!0}},"timer-start":{label:"Timer start event",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!0}},"conditional-start":{label:"Conditional start event",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!0}},"signal-start":{label:"Signal start event",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!0}},"error-start":{label:"Error start event",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",isInterrupting:!0}},"escalation-start":{label:"Escalation start event",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!0}},"compensation-start":{label:"Compensation start event",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",isInterrupting:!0}},"non-interrupting-message-start":{label:"Message start event (non-interrupting)",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},"non-interrupting-timer-start":{label:"Timer start event (non-interrupting)",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},"non-interrupting-conditional-start":{label:"Conditional start event (non-interrupting)",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},"non-interrupting-signal-start":{label:"Signal start event (non-interrupting)",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},"non-interrupting-escalation-start":{label:"Escalation start event (non-interrupting)",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}},"message-intermediate-catch":{label:"Message intermediate catch event",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},"message-intermediate-throw":{label:"Message intermediate throw event",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},"timer-intermediate-catch":{label:"Timer intermediate catch event",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},"escalation-intermediate-throw":{label:"Escalation intermediate throw event",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},"conditional-intermediate-catch":{label:"Conditional intermediate catch event",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},"link-intermediate-catch":{label:"Link intermediate catch event",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},"link-intermediate-throw":{label:"Link intermediate throw event",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},"compensation-intermediate-throw":{label:"Compensation intermediate throw event",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},"signal-intermediate-catch":{label:"Signal intermediate catch event",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},"signal-intermediate-throw":{label:"Signal intermediate throw event",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},"message-boundary":{label:"Message boundary event",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!0}},"timer-boundary":{label:"Timer boundary event",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!0}},"escalation-boundary":{label:"Escalation boundary event",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!0}},"conditional-boundary":{label:"Conditional boundary event",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!0}},"error-boundary":{label:"Error boundary event",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",cancelActivity:!0}},"cancel-boundary":{label:"Cancel boundary event",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition",cancelActivity:!0}},"signal-boundary":{label:"Signal boundary event",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!0}},"compensation-boundary":{label:"Compensation boundary event",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",cancelActivity:!0}},"non-interrupting-message-boundary":{label:"Message boundary event (non-interrupting)",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},"non-interrupting-timer-boundary":{label:"Timer boundary event (non-interrupting)",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},"non-interrupting-escalation-boundary":{label:"Escalation boundary event (non-interrupting)",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},"non-interrupting-conditional-boundary":{label:"Conditional boundary event (non-interrupting)",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},"non-interrupting-signal-boundary":{label:"Signal boundary event (non-interrupting)",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}},"message-end":{label:"Message end event",className:"bpmn-icon-e
355nd-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},"escalation-end":{label:"Escalation end event",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},"error-end":{label:"Error end event",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},"cancel-end":{label:"Cancel end event",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},"compensation-end":{label:"Compensation end event",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},"signal-end":{label:"Signal end event",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},"terminate-end":{label:"Terminate end event",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}};function h_(e,t={}){var n=hb[e];if(!n)throw Error("unknown popup entry <"+e+">");return{...n,actionName:"replace-with-"+e,...t}}var hx=[h_("none-start-event",{actionName:"replace-with-none-start"}),h_("none-intermediate-throwing"),h_("none-end-event",{actionName:"replace-with-none-end"}),h_("message-start"),h_("timer-start"),h_("conditional-start"),h_("signal-start")],hw=[h_("none-start-event",{actionName:"replace-with-none-start"}),h_("none-intermediate-throwing"),h_("none-end-event",{actionName:"replace-with-none-end"})],hE=[h_("none-start-event",{actionName:"replace-with-none-start"}),h_("none-intermediate-throwing",{actionName:"replace-with-none-intermediate-throw"}),h_("none-end-event",{actionName:"replace-with-none-end"}),h_("message-intermediate-catch"),h_("message-intermediate-throw"),h_("timer-intermediate-catch"),h_("escalation-intermediate-throw"),h_("conditional-intermediate-catch"),h_("link-intermediate-catch"),h_("link-intermediate-throw"),h_("compensation-intermediate-throw"),h_("signal-intermediate-catch"),h_("signal-intermediate-throw")],hS=[h_("none-start-event",{actionName:"replace-with-none-start"}),h_("none-intermediate-throwing",{actionName:"replace-with-none-intermediate-throw"}),h_("none-end-event",{actionName:"replace-with-none-end"}),h_("message-end"),h_("escalation-end"),h_("error-end"),h_("cancel-end"),h_("compensation-end"),h_("signal-end"),h_("terminate-end")],hk=[h_("exclusive-gateway"),h_("parallel-gateway"),h_("inclusive-gateway"),h_("complex-gateway"),h_("event-based-gateway")],hC=[h_("transaction"),h_("event-subprocess"),h_("expanded-ad-hoc-subprocess",{actionName:"replace-with-ad-hoc-subprocess",label:"Ad-hoc sub-process"}),h_("collapsed-subprocess")],hR=[h_("expanded-subprocess",{actionName:"replace-with-subprocess",label:"Sub-process"}),h_("transaction"),h_("event-subprocess"),h_("collapsed-ad-hoc-subprocess")],hP=[h_("transaction"),h_("expanded-subprocess",{actionName:"replace-with-subprocess",label:"Sub-process"}),h_("expanded-ad-hoc-subprocess",{actionName:"replace-with-ad-hoc-subprocess",label:"Ad-hoc sub-process"}),h_("event-subprocess")],hA=[h_("task"),h_("user-task"),h_("service-task"),h_("send-task"),h_("receive-task"),h_("manual-task"),h_("rule-task"),h_("script-task"),h_("call-activity"),h_("collapsed-subprocess"),h_("expanded-subprocess"),h_("collapsed-ad-hoc-subprocess"),h_("expanded-ad-hoc-subprocess",{actionName:"replace-with-ad-hoc-subprocess"})],hM=[h_("data-store-reference")],hT=[h_("data-object-reference")],hB=[h_("message-boundary"),h_("timer-boundary"),h_("escalation-boundary"),h_("conditional-boundary"),h_("error-boundary"),h_("cancel-boundary"),h_("signal-boundary"),h_("compensation-boundary"),h_("non-interrupting-message-boundary"),h_("non-interrupting-timer-boundary"),h_("non-interrupting-escalation-boundary"),h_("non-interrupting-conditional-boundary"),h_("non-interrupting-signal-boundary")],hD=[h_("message-start"),h_("timer-start"),h_("conditional-start"),h_("signal-start"),h_("error-start"),h_("escalation-start"),h_("compensation-start"),h_("non-interrupting-message-start"),h_("non-interrupting-timer-start"),h_("non-interrupting-conditional-start"),h_("non-interrupting-signal-start"),h_("non-interrupting-escalation-start")],hj=[{label:"Sequence flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],hO=[h_("expanded-pool"),h_("collapsed-pool",{label:function(e){var t="Empty pool/participant";return e.children&&e.children.length&&(t+=" (removes content)"),t}})],hN={"bpmn:MessageEventDefinition":[h_("message-start"),h_("message-intermediate-catch"),h_("message-intermediate-throw"),h_("message-end")],"bpmn:TimerEventDefinition":[h_("timer-start"),h_("timer-intermediate-catch")],"bpmn:ConditionalEventDefinition":[h_("conditional-start"),h_("conditional-intermediate-catch")],"bpmn:SignalEventDefinition":[h_("signal-start"),h_("signal-intermediate-catch"),h_("signal-intermediate-throw"),h_("signal-end")],"bpmn:ErrorEventDefinition":[h_("error-start"),h_("error-end")],"bpmn:EscalationEventDefinition":[h_("escalation-start"),h_("escalation-intermediate-throw"),h_("escalation-end")],"bpmn:CompensateEventDefinition":[h_("compensation-start"),h_("compensation-intermediate-throw"),h_("compensation-end")]};let hL={"start-event-non-interrupting":` 356 <svg viewBox="0 0 2048 2048" xmlns="http://www.w3.org/2000/svg"> 357 <g transform="translate(0 995.64)"> 358 <path d="m1899 28.357c21.545 567.43-598.38 1023.5-1133.6 835.92-548.09-147.21-801.57-873.95-463.59-1330 302.62-480.3 1071.7-507.54 1407.6-49.847 122.14 153.12 190.07 348.07 189.59 543.91z" fill="none" stroke="currentColor" stroke-dasharray="418.310422, 361.2328165" stroke-linecap="round" stroke-width="100"/> 359 </g> 360 </svg>`,"intermediate-event-non-interrupting":` 361 <svg viewBox="0 0 2048 2048" xmlns="http://www.w3.org/2000/svg"> 362 <g transform="translate(0 995.64)" fill="none" stroke="currentColor" stroke-linecap="round">
363 <circle cx="1024" cy="28.357" r="875" stroke-dasharray="418.310422, 361.2328165" stroke-width="100"/> 364 <circle cx="1024" cy="28.357" r="685" stroke-dasharray="348.31044857,261.23283643" stroke-dashoffset="500" stroke-width="100"/> 365 </g> 366 </svg>`};function h$(e,t,n,i,r,o,a,s){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=i,this._bpmnReplace=r,this._rules=o,this._translate=a,this._moddleCopy=s,this._register()}function hI(e,t,n,i,r,o,a,s,c,l,p,u,h){e=e||{},i.registerProvider(this),this._contextPad=i,this._modeling=r,this._elementFactory=o,this._connect=a,this._create=s,this._popupMenu=c,this._canvas=l,this._rules=p,this._translate=u,this._eventBus=n,this._appendPreview=h,!1!==e.autoPlace&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,function(e){var t=e.context.shape;if(rB(e)&&i.isOpen(t)){var n=i.getEntries(t);n.replace&&n.replace.action.click(e,t)}}),n.on("contextPad.close",function(){h.cleanUp()})}function hF(e,t,n){var i=e.$instanceOf(t),r=!1;return R(e.eventDefinitions||[],function(e){e.$type===n&&(r=!0)}),i&&r}h$.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate","moddleCopy"],h$.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},h$.prototype.getPopupMenuEntries=function(e){var t,n=e.businessObject,i=this._rules,r=[],o=[];if(v(e)||!i.allowed("shape.replace",{element:e}))return{};var a=function(t){var n=t.target,i=id(e),r=i.eventDefinitions&&i.eventDefinitions[0],o=i.$type===n.type,a=(r&&r.$type)===n.eventDefinitionType,s=!!n.triggeredByEvent==!!i.triggeredByEvent,c=void 0===n.isExpanded||n.isExpanded===iA(e);return!o||!a||!s||!c};return iu(n,"bpmn:DataObjectReference")?this._createEntries(e,hM):iu(n,"bpmn:DataStoreReference")&&!iu(e.parent,"bpmn:Collaboration")?this._createEntries(e,hT):(iu(n,"bpmn:Event")&&!iu(n,"bpmn:BoundaryEvent")&&(r=hN[null==(t=n.get("eventDefinitions")[0])?void 0:t.$type]||[],!iT(n.$parent)&&iu(n.$parent,"bpmn:SubProcess")&&(r=C(r,function(e){return"bpmn:StartEvent"!==e.target.type}))),iu(n,"bpmn:StartEvent")&&!iu(n.$parent,"bpmn:SubProcess"))?(o=C(hx.concat(r),a),this._createEntries(e,o)):iu(n,"bpmn:Participant")?(o=C(hO,function(t){return iA(e)!==t.target.isExpanded}),this._createEntries(e,o)):iu(n,"bpmn:StartEvent")&&iT(n.$parent)?(o=C(hD.concat(r),function(e){var t=!1!==e.target.isInterrupting,i=n.isInterrupting===t;return a(e)||!a(e)&&!i}),this._createEntries(e,o)):iu(n,"bpmn:StartEvent")&&!iT(n.$parent)&&iu(n.$parent,"bpmn:SubProcess")?(o=C(hw.concat(r),a),this._createEntries(e,o)):iu(n,"bpmn:EndEvent")?(o=C(hS.concat(r),function(e){return("bpmn:CancelEventDefinition"!=e.target.eventDefinitionType||!!iu(n.$parent,"bpmn:Transaction"))&&a(e)}),this._createEntries(e,o)):iu(n,"bpmn:BoundaryEvent")?(o=C(hB,function(e){var t=e.target;if("bpmn:CancelEventDefinition"==t.eventDefinitionType&&!iu(n.attachedToRef,"bpmn:Transaction"))return!1;var i=!1!==t.cancelActivity,r=n.cancelActivity==i;return a(e)||!a(e)&&!r}),this._createEntries(e,o)):iu(n,"bpmn:IntermediateCatchEvent")||iu(n,"bpmn:IntermediateThrowEvent")?(o=C(hE.concat(r),a),this._createEntries(e,o)):iu(n,"bpmn:Gateway")?(o=C(hk,a),this._createEntries(e,o)):iu(n,"bpmn:Transaction")||iT(n)&&iA(e)?(o=C(hP,a),this._createEntries(e,o)):iu(n,"bpmn:AdHocSubProcess")&&iA(e)?(o=C(hR,a),this._createEntries(e,o)):iu(n,"bpmn:SubProcess")&&iA(e)?(o=C(hC,a),this._createEntries(e,o)):iu(n,"bpmn:SubProcess")&&!iA(e)?(o=C(hA,function(t){return t.target.type===e.type==(!0===t.target.isExpanded)}),this._createEntries(e,o)):iu(n,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,hj):iu(n,"bpmn:FlowNode")?(o=C(hA,a),this._createEntries(e,o)):{}},h$.prototype.getPopupMenuHeaderEntries=function(e){var t={};return iu(e,"bpmn:Activity")&&!iT(e)&&(t={...t,...this._getLoopCharacteristicsHeaderEntries(e)}),iu(e,"bpmn:DataObjectReference")&&(t={...t,...this._getCollectionHeaderEntries(e)}),iu(e,"bpmn:Participant")&&(t={...t,...this._getParticipantMultiplicityHeaderEntries(e)}),cC(e)&&(t={...t,...this._getNonInterruptingHeaderEntries(e)}),t},h$.prototype._createEntries=function(e,t){var n={},i=this;return R(t,function(t){n[t.actionName]=i._createEntry(t,e)}),n},h$.prototype._createSequenceFlowEntries=function(e,t){var n=id(e),i={},r=this._modeling,o=this._moddle,a=this;return R(t,function(t){switch(t.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(iu(n.sourceRef,"bpmn:ExclusiveGateway")||iu(n.sourceRef,"bpmn:InclusiveGateway")||iu(n.sourceRef,"bpmn:ComplexGateway")||iu(n.sourceRef,"bpmn:Activity"))&&(i={...i,[t.actionName]:a._createEntry(t,e,function(){r.updateProperties(e.source,{default:n})})});break;case"replace-with-conditional-flow":!n.conditionExpression&&iu(n.sourceRef,"bpmn:Activity")&&(i={...i,[t.actionName]:a._createEntry(t,e,function(){var t=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(e,{conditionExpression:t})})});break;
vendor: 4,279 bytes, line 366
366default:iu(n.sourceRef,"bpmn:Activity")&&n.conditionExpression&&(i={...i,[t.actionName]:a._createEntry(t,e,function(){r.updateProperties(e,{conditionExpression:void 0})})}),(iu(n.sourceRef,"bpmn:ExclusiveGateway")||iu(n.sourceRef,"bpmn:InclusiveGateway")||iu(n.sourceRef,"bpmn:ComplexGateway")||iu(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n&&(i={...i,[t.actionName]:a._createEntry(t,e,function(){r.updateProperties(e.source,{default:void 0})})})}}),i},h$.prototype._createEntry=function(e,t,n){var i=this._translate,r=this._bpmnReplace.replaceElement,o=e.label;return o&&"function"==typeof o&&(o=o(t)),n=n||function(){return r(t,e.target)},{label:i(o),className:e.className,action:n}},h$.prototype._getLoopCharacteristicsHeaderEntries=function(e){var t,n,i,r=this,o=this._translate;function a(t,n){if(n.active)return void r._modeling.updateProperties(e,{loopCharacteristics:void 0});var i=e.businessObject.get("loopCharacteristics");i&&iu(i,n.options.loopCharacteristics)?r._modeling.updateModdleProperties(e,i,{isSequential:n.options.isSequential}):(i=r._moddle.create(n.options.loopCharacteristics,{isSequential:n.options.isSequential}),r._modeling.updateProperties(e,{loopCharacteristics:i}))}var s=id(e).loopCharacteristics;return s&&(t=s.isSequential,n=void 0===s.isSequential,i=void 0!==s.isSequential&&!s.isSequential),{"toggle-parallel-mi":{className:"bpmn-icon-parallel-mi-marker",title:o("Parallel multi-instance"),active:i,action:a,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},"toggle-sequential-mi":{className:"bpmn-icon-sequential-mi-marker",title:o("Sequential multi-instance"),active:t,action:a,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},"toggle-loop":{className:"bpmn-icon-loop-marker",title:o("Loop"),active:n,action:a,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}}},h$.prototype._getCollectionHeaderEntries=function(e){var t=this,n=this._translate,i=e.businessObject.dataObjectRef;if(!i)return{};var r=i.isCollection;return{"toggle-is-collection":{className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:r,action:function(n,r){t._modeling.updateModdleProperties(e,i,{isCollection:!r.active})}}}},h$.prototype._getParticipantMultiplicityHeaderEntries=function(e){var t=this,n=this._bpmnFactory,i=this._translate,r=e.businessObject.participantMultiplicity;return{"toggle-participant-multiplicity":{className:"bpmn-icon-parallel-mi-marker",title:i("Participant multiplicity"),active:!!r,action:function(i,r){var o;r.active||(o=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:o})}}}},h$.prototype._getNonInterruptingHeaderEntries=function(e){let t=this._translate,n=id(e),i=this,r=cR(e),o=iu(e,"bpmn:BoundaryEvent")?hL["intermediate-event-non-interrupting"]:hL["start-event-non-interrupting"],a=!n[r];return{"toggle-non-interrupting":{imageHtml:o,title:t("Toggle non-interrupting"),active:a,action:function(){i._modeling.updateProperties(e,{[r]:!!a})}}}},hI.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","appendPreview"],hI.prototype.getMultiElementContextPadEntries=function(e){var t=this._modeling,n={};return this._isDeleteAllowed(e)&&G(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Delete"),action:{click:function(e,n){t.removeElements(n.slice())}}}}),n},hI.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return v(t)?A(e,e=>t.includes(e)):t},hI.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,i=this._elementFactory,r=this._connect,o=this._create,a=this._popupMenu,s=this._autoPlace,c=this._translate,l=this._appendPreview,p={};if("label"===e.type)return this._isDeleteAllowed([e])&&G(p,f()),p;var u=e.businessObject;function h(e,t){r.start(e,t)}function d(e,t){n.removeElements([t])}function f(){return{delete:{group:"edit",className:"bpmn-icon-trash",title:c("Delete"),action:{click:d}}}}function m(e,t,n,r){function a(t,n){var a=i.createShape(G({type:e},r));o.start(t,a,{source:n})}var c=s?function(t,n){var o=i.createShape(G({type:e},r));s.append(n,o)}:a;
366return{group:"model",className:t,title:n,action:{dragstart:a,click:c,hover:s?function(t,n){return l.create(n,e,r),()=>{l.cleanUp()}}:null}}}function g(e){return function(i,r){n.splitLane(r,e),t.open(r,!0)}}if(ih(u,["bpmn:Lane","bpmn:Participant"])&&iA(e)){var y=sU(e);G(p,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:c("Add lane above"),action:{click:function(e,t){n.addLane(t,"top")}}}}),y.length<2&&((iM(e)?e.height>=120:e.width>=120)&&G(p,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:c("Divide into two lanes"),action:{click:g(2)}}}),(iM(e)?e.height>=180:e.width>=180)&&G(p,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:c("Divide into three lanes"),action:{click:g(3)}}})),G(p,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:c("Add lane below"),action:{click:function(e,t){n.addLane(t,"bottom")}}}})}return iu(u,"bpmn:FlowNode")&&(iu(u,"bpmn:EventBasedGateway")?G(p,{"append.receive-task":m("bpmn:ReceiveTask","bpmn-icon-receive-task",c("Append receive task")),"append.message-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",c("Append message intermediate catch event"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",c("Append timer intermediate catch event"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",c("Append conditional intermediate catch event"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",c("Append signal intermediate catch event"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):hF(u,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?G(p,{"append.compensation-activity":m("bpmn:Task","bpmn-icon-task",c("Append compensation activity"),{isForCompensation:!0})}):iu(u,"bpmn:EndEvent")||u.isForCompensation||hF(u,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||iT(u)||G(p,{"append.end-event":m("bpmn:EndEvent","bpmn-icon-end-event-none",c("Append end event")),"append.gateway":m("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",c("Append gateway")),"append.append-task":m("bpmn:Task","bpmn-icon-task",c("Append task")),"append.intermediate-event":m("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",c("Append intermediate/boundary event"))})),a.isEmpty(e,"bpmn-replace")||G(p,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:c("Change element"),action:{click:function(e,n){var i,r=G({x:(i=t.getPad(n).html.getBoundingClientRect()).left,y:i.bottom+5},{cursor:{x:e.x,y:e.y}});a.open(n,"bpmn-replace",r,{title:c("Change element"),width:"var(--bpmn-replace-popup-width, 300px)",search:!0})}}}}),iu(u,"bpmn:SequenceFlow")&&G(p,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),iu(u,"bpmn:MessageFlow")&&G(p,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),ih(u,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&G(p,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation")),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect to other element"),action:{click:h,dragstart:h}}}),iu(u,"bpmn:TextAnnotation")&&G(p,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using association"),action:{click:h,dragstart:h}}}),ih(u,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&G(p,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using data input association"),action:{click:h,dragstart:h}}}),iu(u,"bpmn:Group")&&G(p,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),this._isDeleteAllowed([e])&&G(p,f()),p};let hz={__depends__:[{__depends__:[ar,{__depends__:[sl],__init__:["complexPreview"],complexPreview:["type",su]},hl],__init__:["appendPreview"],appendPreview:["type",hu]},hv,oS,rG,si,lJ,{__depends__:[oX,ps,ar],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",h$]}
366],__init__:["contextPadProvider"],contextPadProvider:["type",hI]};var hH={horizontal:["x","width"],vertical:["y","height"]};function hV(e,t){this._modeling=e,this._filters=[],this.registerFilter(function(e){var n=t.allowed("elements.distribute",{elements:e});return v(n)?n:n?e:[]})}function hG(e){o1.call(this,e)}hV.$inject=["modeling","rules"],hV.prototype.registerFilter=function(e){if("function"!=typeof e)throw Error("the filter has to be a function");this._filters.push(e)},hV.prototype.trigger=function(e,t){var n,i,r=this._modeling;if(!(e.length<3)&&(this._setOrientation(t),i=this._filterElements(e),!((n=this._createGroups(i)).length<=2)))return r.distributeElements(n,this._axis,this._dimension),n},hV.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,r=[].concat(e);return t.length?(R(t,function(e){r=e(r,n,i)}),r):e},hV.prototype._createGroups=function(e){var t=[],n=this,i=this._axis,r=this._dimension;if(!i)throw Error('must have a defined "axis" and "dimension"');return R(N(e,i),function(e,o){var a=n._findRange(e,i,r),s=t[t.length-1];s&&n._hasIntersection(s.range,a)?t[t.length-1].elements.push(e):t.push({range:a,elements:[e]})}),t},hV.prototype._setOrientation=function(e){var t=hH[e];this._axis=t[0],this._dimension=t[1]},hV.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},hV.prototype._findRange=function(e){var t=e[this._axis];return{min:t+5,max:t+e[this._dimension]-5}},hG.$inject=["eventBus"],i(hG,o1),hG.prototype.init=function(){this.addRule("elements.distribute",function(e){var t=e.elements;return!((t=eJ(t=C(t,function(e){var t=ih(e,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(e.labelTarget||t)}))).length<3)&&t})};var hW={horizontal:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800"> 367 <polyline points="450 400 450 150 1350 150 1350 400" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/> 368 <rect x="150" y="450" width="600" height="1200" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect> 369 <rect x="1050" y="450" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect> 370 </svg>`,vertical:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800"> 371 <polyline points="400 1350 150 1350 150 450 400 450" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/> 372 <rect x="450" y="150" width="1200" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect> 373 <rect x="450" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect> 374 </svg>`};function hU(e,t,n,i){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",900,this)}hU.$inject=["popupMenu","distributeElements","translate","rules"],hU.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&G(t,this._getEntries(e)),t},hU.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})},hU.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,i=this._popupMenu;return{"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:hW.horizontal,action:function(n,r){t.trigger(e,"horizontal"),i.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:hW.vertical,action:function(n,r){t.trigger(e,"vertical"),i.close()}}}};var hq="is not a registered action";function hK(e,t){this._eventBus=e,this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}function hY(e,t){return Error(e+" "+t)}function hX(e){e.invoke(hK,this)}function hZ(e){e.on(["create.init","shape.move.init"],function(e){var t=e.context;
374ih(e.shape,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(t.gridSnappingContext||(t.gridSnappingContext={}),t.gridSnappingContext.snapLocation="top-left")})}function hJ(e,t){rp.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(e){var t=e.context,i=(t.hints||{}).autoResize;if(i){var r=t.shape,o=t.newBounds;w(i)?t.newBounds=n.snapComplex(o,i):t.newBounds=n.snapSimple(r,o)}})}function hQ(e,t){e.on(["spaceTool.move","spaceTool.end"],2e3,function(e){var n,i=e.context;i.initialized&&("x"===i.axis?(n=t.snapValue(e.dx),e.x=e.x+n-e.dx,e.dx=n):(n=t.snapValue(e.dy),e.y=e.y+n-e.dy,e.dy=n))})}function h0(e,t,n){return n||(n="round"),Math[n](e/t)*t}function h1(e,t,n){var i=!n||!1!==n.active;this._eventBus=t;var r=this;t.on("diagram.init",800,function(){r.setActive(i)}),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],1200,function(t){var n=t.originalEvent;if(!(!r.active||n&&r0(n))){var i=t.context,o=i.gridSnappingContext;o||(o=i.gridSnappingContext={}),["x","y"].forEach(function(n){var i,o,a,s,c,l,p,u,h={},d=(i=t,o=n,a=e,s=i.context,c=i.shape,p=(l=s.gridSnappingContext).snapLocation,(u=l.snapOffset)&&_(u[o])||(u||(u=l.snapOffset={}),_(u[o])||(u[o]=0),c&&(a.get(c.id)||(function(e){return"x"===e}(o)?u[o]+=c[o]+c.width/2:u[o]+=c[o]+c.height/2),p&&("x"===o?/left/.test(p)?u[o]-=c.width/2:/right/.test(p)&&(u[o]+=c.width/2):/top/.test(p)?u[o]-=c.height/2:/bottom/.test(p)&&(u[o]+=c.height/2)))),u[o]);d&&(h.offset=d);var f=function(e,t){var n=e.context,i=n.createConstraints,r=n.resizeConstraints||{},o=n.gridSnappingContext,a=o.snapConstraints;if(a&&a[t])return a[t];a||(a=o.snapConstraints={}),a[t]||(a[t]={});var s=n.direction;i&&(function(e){return"x"===e}(t)?(a.x.min=i.left,a.x.max=i.right):(a.y.min=i.top,a.y.max=i.bottom));var c=r.min,l=r.max;return c&&(function(e){return"x"===e}(t)?h5(s)?a.x.max=c.left:a.x.min=c.right:h2(s)?a.y.max=c.top:a.y.min=c.bottom),l&&(function(e){return"x"===e}(t)?h5(s)?a.x.min=l.left:a.x.max=l.right:h2(s)?a.y.min=l.top:a.y.max=l.bottom),a[t]}(t,n);f&&G(h,f),a2(t,n)||r.snapEvent(t,n,h)})}})}function h2(e){return -1!==e.indexOf("n")}function h5(e){return -1!==e.indexOf("w")}function h3(e,t,n){e.on("autoPlace",2e3,function(e){var i=e.source,r=tO(i),o=e.shape,a=at(i,o,n);return["x","y"].forEach(function(e){var n={};a[e]!==r[e]&&(a[e]>r[e]?n.min=a[e]:n.max=a[e],iu(o,"bpmn:TextAnnotation")&&("x"===e?n.offset=-o.width/2:n.offset=-o.height/2),a[e]=t.snapValue(a[e],n))}),a})}function h6(e,t,n){t.on(["create.start","shape.move.start"],1750,function(t){var i=t.context,r=i.shape,o=e.getRootElement();iu(r,"bpmn:Participant")&&iu(o,"bpmn:Process")&&o.children.length&&i.createConstraints&&(r.width=n.snapValue(r.width,{min:r.width}),r.height=n.snapValue(r.height,{min:r.height}))})}function h9(e,t,n){rp.call(this,e),this._gridSnapping=t;var i=this;this.postExecuted(["connection.create","connection.layout"],3e3,function(e){var t=e.context,r=t.connection,o=t.hints||{},a=r.waypoints;o.connectionStart||o.connectionEnd||!1===o.createElementsBehavior||a.length>3&&n.updateWaypoints(r,i.snapMiddleSegments(a))})}hK.$inject=["eventBus","injector"],hK.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),i=e.get("selection",!1),r=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),c=e.get("keyboardMove",!1),l=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&i&&this.register("copy",function(){var e=i.get();if(e.length)return o.copy(e)}),o&&i&&this.register("duplicate",function(){var e=i.get();if(e.length)return o.duplicate(e)}),o&&this.register("paste",function(){o.paste()}),o&&i&&s&&this.register("cut",function(){var e=i.get();if(e.length){var t=s.allowed("elements.delete",{elements:e});if(!1!==t){var n=v(t)?t:e;return o.cut(n.slice())}}}),r&&this.register("stepZoom",function(e){r.stepZoom(e.value)}),a&&this.register("zoom",function(e){a.zoom(e.value)}),n&&i&&s&&this.register("removeSelection",function(){var e=i.get();if(e.length){var t,r=s.allowed("elements.delete",{elements:e});if(!1===r)return;(t=v(r)?r:e).length&&n.removeElements(t.slice())}}),c&&this.register("moveCanvas",function(e){c.moveCanvas(e)}),l&&this.register("moveSelection",function(e){l.moveSelection(e.direction,e.accelerated)})},hK.prototype.trigger=function(e,t){if(!this._actions[e])throw hY(e,hq);if(!1!==this._eventBus.fire("editorActions.allowed",{action:e,opts:t}))return this._actions[e](t)},hK.prototype.register=function(e,t){var n=this;if("string"==typeof e)return this._registerAction(e,t);R(e,function(e,t){n._registerAction(t,e)})},hK.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw hY(e,"is already registered");this._actions[e]=t},hK.prototype.unregister=function(e){if(!this.isRegistered(e))throw hY(e,hq);this._actions[e]=void 0},hK.prototype.getActions=function(){return Object.keys(this._actions)},hK.prototype.isRegistered=function(e){return!!this._actions[e]},i(hX,hK),hX.$inject=["injector"],hX.prototype._registerDefaultActions=function(e){hK.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),i=e.get("selection",!1),r=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),s=e.get("globalConnect",!1),c=e.get("distributeElements",!1),l=e.get("alignElements",!1),p=e.get("directEditing",!1),u=e.get("searchPad",!1),h=e.get("modeling",!1),d=e.get("
374contextPad",!1);t&&n&&i&&this._registerAction("selectElements",function(){var e=t.getRootElement(),r=n.filter(function(t){return t!==e});return i.select(r),r}),r&&this._registerAction("spaceTool",function(){r.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),a&&this._registerAction("handTool",function(){a.toggle()}),s&&this._registerAction("globalConnectTool",function(){s.toggle()}),i&&c&&this._registerAction("distributeElements",function(e){var t=i.get(),n=e.type;t.length&&c.trigger(t,n)}),i&&l&&this._registerAction("alignElements",function(e){var t=i.get(),n=[],r=e.type;t.length&&(n=C(t,function(e){return!iu(e,"bpmn:Lane")}),l.trigger(n,r))}),i&&h&&this._registerAction("setColor",function(e){var t=i.get();t.length&&h.setColor(t,e)}),i&&p&&this._registerAction("directEditing",function(){var e=i.get();e.length&&p.activate(e[0])}),u&&this._registerAction("find",function(){u.toggle()}),t&&h&&this._registerAction("moveToOrigin",function(){var e,i,r=t.getRootElement();e=e2(i=iu(r,"bpmn:Collaboration")?n.filter(function(e){return iu(e.parent,"bpmn:Collaboration")}):n.filter(function(e){return e!==r&&!iu(e.parent,"bpmn:SubProcess")})),h.moveElements(i,{x:-e.x,y:-e.y},r)}),i&&d&&this._registerAction("replaceElement",function(e){d.triggerEntry("replace","click",e)})},hZ.$inject=["eventBus"],hJ.$inject=["eventBus","gridSnapping","modeling"],i(hJ,rp),hJ.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},hJ.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e},hJ.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,i=/w/.test(t),r=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),r&&(i?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),G(e,o),e},hJ.prototype.snapVertically=function(e,t){var n=this._gridSnapping,i=/n/.test(t),r=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),i&&(r?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),G(e,o),e},hQ.$inject=["eventBus","gridSnapping"],h1.prototype.snapEvent=function(e,t,n){var i=this.snapValue(e[t],n);a5(e,t,i)},h1.prototype.getGridSpacing=function(){return 10},h1.prototype.snapValue=function(e,t){var n,i,r=0;return t&&t.offset&&(r=t.offset),e+=r,e=h0(e,10),t&&t.min&&_(n=t.min)&&(e=Math.max(e,n=h0(n+r,10,"ceil"))),t&&t.max&&_(i=t.max)&&(e=Math.min(e,i=h0(i+r,10,"floor"))),e-=r},h1.prototype.isActive=function(){return this.active},h1.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},h1.prototype.toggleActive=function(){this.setActive(!this.active)},h1.$inject=["elementRegistry","eventBus","config.gridSnapping"],h3.$inject=["eventBus","gridSnapping","elementRegistry"],h6.$inject=["canvas","eventBus","gridSnapping"],h9.$inject=["eventBus","gridSnapping","modeling"],i(h9,rp),h9.prototype.snapMiddleSegments=function(e){var t,n=this._gridSnapping;e=e.slice();for(var i=1;i<e.length-2;i++)t=function(e,t,n){var i=ti(t,n),r={};return"h"===i&&(r.y=e.snapValue(t.y)),"v"===i&&(r.x=e.snapValue(t.x)),("x"in r||"y"in r)&&(t=G({},t,r),n=G({},n,r)),[t,n]}(n,e[i],e[i+1]),e[i]=t[0],e[i+1]=t[1];return e};let h4={__depends__:[{__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",hJ],gridSnappingSpaceToolBehavior:["type",hQ]}],__init__:["gridSnapping"],gridSnapping:["type",h1]},{__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",h3],gridSnappingParticipantBehavior:["type",h6],gridSnappingLayoutConnectionBehavior:["type",h9]}],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",hZ]};function h8(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(e){var t=e.element,i=e.gfx;if(iu(t,"bpmn:Lane"))return n._createParticipantHit(t,i);if(iu(t,"bpmn:Participant"))if(iA(t))return n._createParticipantHit(t,i);else return n._createDefaultHit(t,i);if(iu(t,"bpmn:SubProcess"))if(iA(t))return n._createSubProcessHit(t,i);else return n._createDefaultHit(t,i)})}function h7(e){e.invoke(r9,this)}h8.$inject=["eventBus","interactionEvents"],h8.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0},h8.prototype._createParticipantHit=function(e,t){this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height});var n=iM(e)?{width:30,height:e.height}:{width:e.width,height:30};return this._interactionEvents.createBoxHit(t,"all",n),!0},h8.prototype._createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:30}),!0},i(h7,r9),h7.$inject=["injector"];var de={selectElements:{key:"A",modifier:"cmd"},find:{key:"F",modifier:"cmd"},spaceTool:{key:"S"},lassoTool:{key:"L"},handTool:{key:"H"},globalConnectTool:{key:"C"},directEditing:{key:"E"},replaceElement:{key:"R"}};h7.prototype.registerBindings=function(e,t){r9.prototype.registerBindings.call(this,e,t),R(de,function(n,i){if
374(t.isRegistered(i)){var r=[n.key.toLowerCase(),n.key.toUpperCase()],o="cmd"===n.modifier;e.addListener(function(n){var a=n.keyEvent;if(e.isKey(r,a)){if(o){if(!e.isCmd(a))return}else if(e.hasModifier(a))return;return t.trigger(i,a),!0}})}})};var dt={moveSpeed:1,moveSpeedAccelerated:10},dn="left",di="right",dr="down",da={ArrowLeft:dn,Left:dn,ArrowUp:"up",Up:"up",ArrowRight:di,Right:di,ArrowDown:dr,Down:dr},ds={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function dc(e,t,n,i,r){var o=this;this._config=G({},dt,e||{}),t.addListener(1500,function(e){var n=e.keyEvent,i=da[n.key];if(i&&!t.isCmd(n)){var r=t.isShift(n);return o.moveSelection(i,r),!0}}),this.moveSelection=function(e,t){var o=r.get();if(o.length){var a=this._config[t?"moveSpeedAccelerated":"moveSpeed"],s=ds[e](a);i.allowed("elements.move",{shapes:o,hints:{keyboardMove:!0}})&&n.moveElements(o,s)}}}function dl(e,t,n,i){this._dragging=i,this._rules=t;var r=this;e.on("resize.start",function(e){var t,n,i;n=(t=e.context).resizeConstraints,i=t.minBounds,void 0===n&&(void 0===i&&(i=r.computeMinResizeBox(t)),t.resizeConstraints={min:tD(i)})}),e.on("resize.move",function(e){var t,n,i,o,a,s,c,l={x:e.dx,y:e.dy};t=e.context,n=t.shape,i=t.direction,o=t.resizeConstraints,t.delta=l,a=l.x,s=l.y,c={x:n.x,y:n.y,width:n.width,height:n.height},-1!==i.indexOf("n")?(c.y=n.y+s,c.height=n.height-s):-1!==i.indexOf("s")&&(c.height=n.height+s),-1!==i.indexOf("e")?c.width=n.width+a:-1!==i.indexOf("w")&&(c.x=n.x+a,c.width=n.width-a),t.newBounds=function(e,t){if(!t)return e;var n=tD(e);return tj({top:sI("top",n,t),right:sI("right",n,t),bottom:sI("bottom",n,t),left:sI("left",n,t)})}(c,o),t.canExecute=r.canResize(t)}),e.on("resize.end",function(e){!function(e){var t,i,r=e.shape,o=e.canExecute,a=e.newBounds;if(o){if(t=r,i=a=tT(a),t.x===i.x&&t.y===i.y&&t.width===i.width&&t.height===i.height)return;n.resizeShape(r,a)}}(e.context)})}function dp(e,t){var n=tO(e),i=tD(e),r={x:n.x,y:n.y};return -1!==t.indexOf("n")?r.y=i.top:-1!==t.indexOf("s")&&(r.y=i.bottom),-1!==t.indexOf("e")?r.x=i.right:-1!==t.indexOf("w")&&(r.x=i.left),r}dc.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"],dl.prototype.canResize=function(e){var t=this._rules,n=W(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},dl.prototype.activate=function(e,t,n){var i,r,o,a,s=this._dragging;if("string"==typeof n&&(n={direction:n}),!(a=(o=G({shape:t},n)).direction))throw Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");s.init(e,dp(t,a),"resize",{autoActivate:!0,cursor:(r="resize-","n"===(i=a)||"s"===i?r+"ns":"e"===i||"w"===i?r+"ew":"nw"===i||"se"===i?r+"nwse":r+"nesw"),data:{shape:t,context:o}})},dl.prototype.computeMinResizeBox=function(e){var t,n,i,r,o,a=e.shape,s=e.direction;return r=e.minDimensions||{width:10,height:10},o=sH(a,e.childrenBoxPadding),t=tD(a),n={top:/n/.test(s)?t.bottom-r.height:t.top,left:/w/.test(s)?t.right-r.width:t.left,bottom:/s/.test(s)?t.top+r.height:t.bottom,right:/e/.test(s)?t.left+r.width:t.right},i=o?tD(o):n,tj({top:sL(n.top,i.top),left:sL(n.left,i.left),bottom:sN(n.bottom,i.bottom),right:sN(n.right,i.right)})},dl.$inject=["eventBus","rules","modeling","dragging"];var du="djs-resizing",dh="resize-not-ok";function dd(e,t,n){e.on("resize.move",500,function(e){var i,r,o,a;r=(i=e.context).shape,o=i.newBounds,(a=i.frame)||(a=i.frame=n.addFrame(r,t.getActiveLayer()),t.addMarker(r,du)),o.width>5&&eg(a,{x:o.x,width:o.width}),o.height>5&&eg(a,{y:o.y,height:o.height}),i.canExecute?ev(a).remove(dh):ev(a).add(dh)}),e.on("resize.cleanup",function(e){var n,i;i=(n=e.context).shape,n.frame&&eO(n.frame),t.removeMarker(i,du)})}dd.$inject=["eventBus","canvas","previewSupport"];var df="djs-resizer",dm=["n","w","s","e","nw","ne","se","sw"];function dg(e,t,n,i){this._resize=i,this._canvas=t;var r=this;e.on("selection.changed",function(e){var t=e.newSelection;r.removeResizers(),1===t.length&&R(t,V(r.addResizer,r))}),e.on("shape.changed",function(e){var t=e.element;n.isSelected(t)&&(r.removeResizers(),r.addResizer(t))})}dg.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(t){rT(t)&&i.activate(t,e,n)}en.bind(t,"mousedown",r),en.bind(t,"touchstart",r)},dg.prototype._createResizer=function(e,t,n,i){var r,o,a=this._getResizersParent(),s=(o={x:0,y:0},-1!==(r=i).indexOf("e")?o.x=6:-1!==r.indexOf("w")&&(o.x=-6),-1!==r.indexOf("s")?o.y=6:-1!==r.indexOf("n")&&(o.y=-6),o),c=ek("g");
vendor: 8,444 bytes, line 374
374ev(c).add(df),ev(c).add(df+"-"+e.id),ev(c).add(df+"-"+i),ed(a,c);var l=ek("rect");eg(l,{x:-4+s.x,y:-4+s.y,rx:2,width:8,height:8}),ev(l).add(df+"-visual"),ed(c,l);var p=ek("rect");return eg(p,{x:-10+s.x,y:-10+s.y,width:20,height:20}),ev(p).add(df+"-hit"),ed(c,p),nt(c,t,n),c},dg.prototype.createResizer=function(e,t){var n=dp(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},dg.prototype.addResizer=function(e){var t=this;tA(e)||R(dm,function(n){t._resize.canResize({shape:e,direction:n})&&t.createResizer(e,n)})},dg.prototype.removeResizers=function(){e_(this._getResizersParent())},dg.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},dg.$inject=["eventBus","canvas","selection","resize"];let dy={__depends__:[ay,af,sl],__init__:["resize","resizePreview","resizeHandles"],resize:["type",dl],resizePreview:["type",dd],resizeHandles:["type",dg]};function dv(e,t,n,i,r,o,a){function s(e,t){(t||ih(e,["bpmn:Activity","bpmn:Event","bpmn:TextAnnotation","bpmn:Participant"]))&&i.activate(e)}this._bpmnFactory=t,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),e.on("element.dblclick",function(e){s(e.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],function(){i.isActive()&&i.complete()}),e.on(["shape.remove","connection.remove"],2e3,function(e){i.isActive(e.element)&&i.cancel()}),e.on(["commandStack.changed"],function(e){i.isActive()&&i.cancel()}),e.on("directEditing.activate",function(e){o.removeResizers()}),e.on("create.end",500,function(e){var t=e.context,n=t.shape,i=e.context.canExecute;e.isTouch||!i||t.hints&&!1===t.hints.createElementsBehavior||s(n)}),e.on("autoPlace.end",500,function(e){s(e.shape)})}function db(e){return iu(e,"bpmn:SubProcess")&&!iA(e)}dv.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],dv.prototype.activate=function(e){var t=i$(e);if(void 0!==t){var n={text:t};G(n,this.getEditingBBox(e));var i={},r=n.style||{};return G(r,{backgroundColor:null,border:null}),(ih(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||db(e))&&G(i,{centerVertically:!0}),ij(e)&&(G(i,{resizable:!0,autoResize:!0}),G(r,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),iu(e,"bpmn:TextAnnotation")&&(G(i,{resizable:!0,autoResize:!0}),G(r,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),G(n,{options:i,style:r}),n}},dv.prototype.getEditingBBox=function(e){var t,n,i,r=this._canvas,o=e.label||e,a=r.getAbsoluteBBox(o),s={x:a.x+a.width/2,y:a.y+a.height/2},c={x:a.x,y:a.y},l=r.zoom(),p=this._textRenderer.getDefaultStyle(),u=this._textRenderer.getExternalStyle(),h=u.fontSize*l,d=u.lineHeight,f=p.fontSize*l,m=p.lineHeight,g={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};if(iu(e,"bpmn:Lane")||iu(t=e,"bpmn:Participant")&&iA(t)){var y=iM(e);G(c,y?{width:a.height,height:30*l,x:a.x-a.height/2+15*l,y:s.y-30*l/2}:{width:a.width,height:30*l}),G(g,{fontSize:f+"px",lineHeight:m,paddingTop:7*l+"px",paddingBottom:7*l+"px",paddingLeft:5*l+"px",paddingRight:5*l+"px",transform:y?"rotate(-90deg)":null})}if(iu(n=e,"bpmn:Participant")&&!iA(n)){var v=iM(e);G(c,v?{width:a.width,height:a.height}:{width:a.height,height:a.width,x:s.x-a.height/2,y:s.y-a.width/2}),G(g,{fontSize:f+"px",lineHeight:m,paddingTop:7*l+"px",paddingBottom:7*l+"px",paddingLeft:5*l+"px",paddingRight:5*l+"px",transform:v?null:"rotate(-90deg)"})}(ih(e,["bpmn:Task","bpmn:CallActivity"])||db(e))&&(G(c,{width:a.width,height:a.height}),G(g,{fontSize:f+"px",lineHeight:m,paddingTop:7*l+"px",paddingBottom:7*l+"px",paddingLeft:5*l+"px",paddingRight:5*l+"px"})),iu(i=e,"bpmn:SubProcess")&&iA(i)&&(G(c,{width:a.width,x:a.x}),G(g,{fontSize:f+"px",lineHeight:m,paddingTop:7*l+"px",paddingBottom:7*l+"px",paddingLeft:5*l+"px",paddingRight:5*l+"px"}));var b=a.width+2;if(o.labelTarget&&(G(c,{width:b,height:a.height+2,x:a.x-1,y:a.y-1}),G(g,{fontSize:h+"px",lineHeight:d})),ij(o)&&!iO(o)&&!tM(o)){var _=iN(e),x=r.getAbsoluteBBox({x:_.x,y:_.y,width:0,height:0}),w=iD.width*l+2;G(c,{width:w,height:h+2,x:x.x-w/2,y:x.y-h/2-1}),G(g,{fontSize:h+"px",lineHeight:d})}return iu(e,"bpmn:TextAnnotation")&&(G(c,{width:a.width+2,height:a.height+2,x:a.x-1,y:a.y-1,minWidth:30*l,minHeight:10*l}),G(g,{textAlign:"left",paddingTop:7*l+"px",paddingBottom:7*l+"px",paddingLeft:7*l+"px",paddingRight:7*l+"px",fontSize:f+"px",lineHeight:m})),{bounds:c,style:g}},dv.prototype.update=function(e,t,n,i){var r,o,a;iu(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),r={x:e.x,y:e.y,width:e.width/o.width*i.width,height:e.height/o.height*i.height}),(a=t)&&a.trim()||(t=null),this._modeling.updateLabel(e,t,r)};var d_="djs-element-hidden",dx="djs-label-hidden";function dw(e,t,n){var i,r,o,a=this,s=t.getDefaultLayer();e.on("directEditing.activate",function(e){var c=e.active;if(iu(i=c.element.label||c.element,"bpmn:TextAnnotation")){r=t.getAbsoluteBBox(i),o=ek("g");var l=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:i.width,containerHeight:i.height,position:{mx:0,my:0}}),p=a.path=ek("path");eg(p,{d:l,strokeWidth:2,stroke:im(i).get("stroke")||void 0||"black"}),ed(o,p),ed(s,o),nn(o,i.x,i.y)}iu(i,"bpmn:TextAnnotation")||i.labelTarget?t.addMarker(i,d_):(iu(i,"bpmn:Task")||iu(i,"bpmn:CallActivity")||iu(i,"bpmn:SubProcess")||iu(i,"bpmn:Participant")||iu(i,"bpmn:Lane"))&&t.addMarker(i,dx)}),e.on("directEditing.resize",function(e){if(iu(i,"bpmn:TextAnnotation")){var t=e.height,o=e.dy,s=Math.max(i.height/r.height*(t+o),0),c=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:i.width,containerHeight:s,position:{mx:0,my:0}});eg(a.path,{d:c})}}),e.on(["directEditing.complete","directEditing.cancel"],function(e){var n=e.active;n&&(t.removeMarker(n.element.label||n.element,d_),t.removeMarker(i,dx)),i=void 0,r=void 0,o&&(eO(o),o=void 0)})}function dE(e,t,n){this._eventBus=e,this._elementRegistry=n,this._outlineOffset=5,this._outlineStyle=t.cls("djs-outline",["no-fill"]);var i=this;function r(e){b(e)&&y(e.parent)||i.createOutline(e)}e.on("element.hover",function(e){r(e.element)}),e.on("selection.changed",function(e){R(e.newSelection,r)}),e.on(["shape.changed","connection.changed"],500,function(e){var t=e.element,n=es(".djs-outline",e.gfx);n&&i.updateOutline(t,n)})}function dS(e,t,n){this._canvas=t;var i=this;e.on("element.changed",function(e){n.isSelected(e.element)&&i._updateMultiSelectionOutline(n.get())}),e.on("selection.changed",function(e){var t=e.newSelection;i._updateMultiSelectionOutline(t)})}dw.$inject=["eventBus","canvas","pathMap"],dE.prototype.createOutline=function(e){var t=this._elementRegistry.getGraphics(e);if(!t)throw Error("cannot create outline for non-rendered element");var n=es(".djs-outline",t);return n||(ed(t,n=this.getOutline(e)||this._createOutlineGfx()),this.updateOutline(e,n)),n},dE.prototype._createOutlineGfx=function(){var e=ek("rect");return eg(e,G({x:0,y:0,rx:4,width:100,height:100},this._outlineStyle)),e},dE.prototype.updateOutline=function(e,t){e.waypoints?this.updateConnectionOutline(t,e):this.updateShapeOutline(t,e)},dE.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&R(i,function(i){n=n||i.updateOutline(t,e)}),n||eg(e,{x:-this._outlineOffset,y:-this._outlineOffset,width:t.width+2*this._outlineOffset,height:t.height+2*this._outlineOffset})},dE.prototype.updateConnectionOutline=function(e,t){var n=e2(t);eg(e,{x:n.x-this._outlineOffset,y:n.y-this._outlineOffset,width:n.width+2*this._outlineOffset,height:n.height+2*this._outlineOffset})},dE.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("outline.getProviders",e,function(e){e.providers.push(t)})},dE.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},dE.prototype.getOutline=function(e){var t;return R(this._getProviders(),function(n){x(n.getOutline)&&(t=t||n.getOutline(e))}),t},dE.$inject=["eventBus","styles","elementRegistry"],dS.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");e_(t);var n=e.length>1;if(ev(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var i,r={x:(i=e2(e)).x-6,y:i.y-6,width:i.width+12,height:i.height+12},o=ek("rect");eg(o,G({rx:3}
374,r)),ev(o).add("djs-selection-outline"),ed(t,o)}},dS.$inject=["eventBus","canvas","selection"];let dk={__depends__:[rG],__init__:["outline","multiSelectionOutline"],outline:["type",dE],multiSelectionOutline:["type",dS]},dC=["bpmn:Event","bpmn:SequenceFlow","bpmn:Gateway"],dR={class:"bjs-label-link",stroke:"var(--element-selected-outline-secondary-stroke-color)",strokeDasharray:"5, 5"};function dP(e,t,n,i,r){let o=t.getLayer("overlays");function a(e,t){let n,i=tO(e),a=tA(t)?cp(i,function(e){for(var t=[],n=0;n<e.length-1;n++)t.push([e[n],e[n+1]]);return t}(t.waypoints)):tO(t),l=eX([a,i],dR),p=l.getAttribute("d"),u=tL(r.isSelected(e)?s(e):c(e),p);!u||15>aS(n=tA(t)?a:tL(r.isSelected(t)?s(t):c(t),p)||tO(t),u)||(eZ(l,[n,u]),ed(o,l))}function s(e){let t=i.getOutline(e);if(!t)return c(e);if(t.x)return iq({x:e.x+dA(t,"x")-2,y:e.y+dA(t,"y")-2,width:dA(t,"width")+4,height:dA(t,"height")+4},dA(t,"rx"));if(t.cx){let n=dA(t,"r");return iU({x:e.x+dA(t,"cx")-n,y:e.y+dA(t,"cy")-n,width:2*n,height:2*n})}}function c(e){return n.getShapePath(e)}e.on(["selection.changed","shape.changed"],function(){ec(`.${dR.class}`,o).forEach(eO)}),e.on("selection.changed",function({newSelection:e}){let t=e.filter(e=>ih(e,dC));if(1===t.length){var n;let e=t[0];tM(e)?a(e,e.labelTarget):null!=(n=e.labels)&&n.length&&a(e.labels[0],e)}if(2===t.length){let e=t.find(tM),n=t.find(t=>{var n;return null==(n=t.labels)?void 0:n.includes(e)});e&&n&&a(e,n)}}),e.on("shape.changed",function({element:e}){var t,n;ih(e,dC)&&(n=e,r.isSelected(n))&&(tM(e)?a(e,e.labelTarget):null!=(t=e.labels)&&t.length&&a(e.labels[0],e))})}function dA(e,t){return parseFloat(eg(e,t)||0)}dP.$inject=["eventBus","canvas","graphicsFactory","outline","selection"];var dM=new rt("tt");function dT(e,t){e.style.display=!1===t?"none":""}var dB="djs-tooltip",dD="."+dB;function dj(e,t){this._eventBus=e,this._canvas=t,this._ids=dM,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=(n=t.getContainer(),q(i=eu('<div class="djs-tooltip-container" />'),{position:"absolute",width:"0",height:"0"}),n.insertBefore(i,n.firstChild),i);var n,i,r=this;er(this._tooltipRoot,dD,"mousedown",function(e){e.stopPropagation()}),er(this._tooltipRoot,dD,"mouseover",function(e){r.trigger("mouseover",e)}),er(this._tooltipRoot,dD,"mouseout",function(e){r.trigger("mouseout",e)}),this._init()}function dO(e,t,n){function i(e,n,i){t.add({position:{x:e.x+5,y:e.y+5},type:"error",timeout:i||2e3,html:"<div>"+n+"</div>"})}e.on(["shape.move.rejected","create.rejected"],function(e){var t=e.context,r=t.shape;iu(t.target,"bpmn:Collaboration")&&(iu(r,"bpmn:FlowNode")?i(e,n("flow elements must be children of pools/participants")):iu(r,"bpmn:DataObjectReference")&&i(e,n("Data object must be placed within a pool/participant.")))})}dj.$inject=["eventBus","canvas"],dj.prototype.add=function(e){if(!e.position)throw Error("must specifiy tooltip position");if(!e.html)throw Error("must specifiy tooltip html");var t=this._ids.next();return e=G({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},dj.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get(K(n,"data-tooltip-id"));i&&("mouseover"===e&&i.timeout&&this.clearTimeout(i),"mouseout"===e&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},dj.prototype.get=function(e){return"string"!=typeof e&&(e=e.id),this._tooltips[e]},dj.prototype.clearTimeout=function(e){if(e=this.get(e)){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},dj.prototype.setTimeout=function(e){if(e=this.get(e)){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}},dj.prototype.remove=function(e){var t=this.get(e);t&&(el(t.html),el(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},dj.prototype.show=function(){dT(this._tooltipRoot)},dj.prototype.hide=function(){dT(this._tooltipRoot,!1)},dj.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,i="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},dj.prototype._addTooltip=function(e){var t,n=e.id,i=e.html,r=this._tooltipRoot;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),w(i)&&(i=eu(i)),q(t=eu('<div data-tooltip-id="'+n+'" class="'+dB+'">'),{position:"absolute"}),t.appendChild(i),e.type&&X(t).add("djs-tooltip-"+e.type),e.className&&X(t).add(e.className),e.htmlContainer=t,r.appendChild(t),this._tooltips[n]=e,this._updateTooltip(e)},dj.prototype._updateTooltip=function(e){var t,n=e.position;t=e.htmlContainer,q(t,{left:n.x+"px",top:n.y+"px"})},dj.prototype._updateTooltipVisibilty=function(e){R(this._tooltips,function(t){var n=t.show,i=t.htmlContainer,r=!0;
374n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(r=!1),dT(i,r))})},dj.prototype._init=function(){var e=this;this._eventBus.on("canvas.viewbox.changing",function(t){e.hide()}),this._eventBus.on("canvas.viewbox.changed",function(t){var n;n=t.viewbox,e._updateRoot(n),e._updateTooltipVisibilty(n),e.show()})},dO.$inject=["eventBus","tooltips","translate"];var dN=Math.round;function dL(e,t,n,i,r){function o(e,t,n,i){return r.allowed("elements.move",{shapes:e,delta:t,position:n,target:i})}function a(e,n,i,r){if((b(i)&&(r=i,i=!1),!n.waypoints&&n.parent)&&!ev(e.target).has("djs-hit-no-move")){var o={x:n.x+dN(n.width/2),y:n.y+dN(n.height/2)};if(!1!==t.init(e,o,"shape.move",{cursor:"grabbing",autoActivate:i,data:{shape:n,context:r||{}}}))return!0}}e.on("shape.move.start",1500,function(e){var t,n,r=e.context,o=e.shape,a=i.get().slice();-1===a.indexOf(o)&&(a=[o]),G(r,{shapes:(n=j(t=a,"id"),a=C(t,function(e){for(;e=e.parent;)if(n[e.id])return!1;return!0})),validatedShapes:a,shape:o})}),e.on("shape.move.start",1250,function(e){var t=e.context,n=t.validatedShapes;if(!(t.canExecute=o(n)))return!1}),e.on("shape.move.move",500,function(e){var t,n=e.context,i=n.validatedShapes,r=e.hover,a={x:e.dx,y:e.dy};if(t=o(i,a,{x:e.x,y:e.y},r),n.delta=a,n.canExecute=t,null===t){n.target=null;return}n.target=r}),e.on("shape.move.end",function(e){var t=e.context,i=t.delta,r=t.canExecute,o=t.shapes;if(!1===r)return!1;i.x=dN(i.x),i.y=dN(i.y),(0!==i.x||0!==i.y)&&n.moveElements(o,i,t.target,{primaryShape:t.shape,attach:"attach"===r})}),e.on("element.mousedown",function(e){if(rT(e)){var t=rC(e);if(!t)throw Error("must supply DOM mousedown event");return a(t,e.element)}}),this.start=a}dL.$inject=["eventBus","dragging","modeling","selection","rules"];var d$="djs-dragging",dI="drop-ok",dF="drop-not-ok",dz="new-parent",dH="attach-ok";function dV(e,t,n,i){function r(e){var t=e1(e),n=t.flatMap(e=>(e.incoming||[]).concat(e.outgoing||[]));return[...new Set(t.concat(n))]}function o(e,n){[dH,dI,dF,dz].forEach(function(i){i===n?t.addMarker(e,i):t.removeMarker(e,i)})}e.on("shape.move.start",499,function(e){var o,a,s=e.context,c=s.shapes,l=s.allDraggedElements,p=(o=r(c),a=new Set,o.forEach(function(e){a.add(e.id)}),C(o,function(e){return!tA(e)||a.has(e.source.id)&&a.has(e.target.id)}));if(!s.dragGroup){var u=ek("g");eg(u,n.cls("djs-drag-group",["no-events"])),ed(t.getActiveLayer(),u),s.dragGroup=u}p.forEach(function(e){i.addDragger(e,s.dragGroup)}),R(l=l?h([l,r(c)]):r(c),function(e){t.addMarker(e,d$)}),s.allDraggedElements=l,s.differentParents=1!==B(j(c,function(e){return e.parent&&e.parent.id})).length}),e.on("shape.move.move",499,function(e){var t=e.context,n=t.dragGroup,i=t.target,r=t.shape.parent,a=t.canExecute;i&&("attach"===a?o(i,dH):t.canExecute&&r&&i.id!==r.id?o(i,dz):o(i,t.canExecute?dI:dF)),nn(n,e.dx,e.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(e){var t=e.context.target;t&&o(t,null)}),e.on("shape.move.cleanup",function(e){var n=e.context,i=n.allDraggedElements,r=n.dragGroup;R(i,function(e){t.removeMarker(e,d$)}),r&&eO(r)}),this.makeDraggable=function(e,n,r){i.addDragger(n,e.dragGroup),r&&t.addMarker(n,d$),e.allDraggedElements?e.allDraggedElements.push(n):e.allDraggedElements=[n]}}function dG(e){this._canvas=e,this._mount=null,this._current=null,this._showTimer=null}dV.$inject=["eventBus","canvas","styles","previewSupport"],dG.$inject=["canvas"],dG.prototype.add=function(e){let{container:t,selector:n,showDelay:i=300}=e;er(t,n,"mouseover",t=>this._show(t.delegateTarget,e,i)),er(t,n,"mouseout",e=>{let{delegateTarget:t,relatedTarget:n}=e;n&&t.contains(n)||this._hide()})},dG.prototype._show=function(e,t,n){let i=t.getContent(e);i&&(this._current={target:e,content:i,getPosition:t.getPosition},clearTimeout(this._showTimer),this._showTimer=setTimeout(()=>this._render(),n))},dG.prototype._hide=function(){clearTimeout(this._showTimer),this._current=null,this._render()},dG.prototype._render=function(){let e=this._getMount();if(!this._current)return void(0,ok.XX)(null,e);let{target:t,content:n,getPosition:i}=this._current,{x:r,y:o,placement:a="right"}=i(t),s={left:`${r}px`,top:`${o}px`};(0,ok.XX)(oA`<div 375 class="djs-hover-tooltip djs-hover-tooltip--${a}" 376 style=${s} 377 >${n}</div>`,e)},dG.prototype._getMount=function(){return this._mount||(this._mount=eu('<div class="djs-hover-tooltip-container"></div>'),this._canvas.getContainer().appendChild(this._mount)),this._mount};var dW=".djs-palette-toggle",dU=".entry",dq=dW+", "+dU,dK="djs-palette-",dY="open",dX="two-column";function dZ(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(e){var t=e.tool;n.updateToolHighlight(t)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}function dJ(e,t){var n=t.getPaletteEntries();return x(n)?n(e):(R(n,function(t,n){e[n]=t}),e)}function dQ(e){let{title:t,shortcut:n}=e,i=n?oA`<kbd class="djs-palette-tooltip-shortcut">${n}</kbd>`:null;return oA` 378 <span class="djs-palette-tooltip-label">${t}</span> 379 ${i} 380 `}function d0(e,t,n){this._palette=t,this._hoverTooltip=n,this._entries={},e.on("palette.create",e=>this._init(e.container)),e.on("palette.changed",()=>this._updateEntries())}dZ.$inject=["eventBus","canvas"],dZ.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("palette.getProviders",e,function(e){e.providers.push(t)}),this._rebuild()},dZ.prototype.getEntries=function(){return this._getProviders().reduce(dJ,{})},dZ.prototype._rebuild=function(){!this._diagramInitialized||this._getProviders().length&&(this._container||this._init(),this._update())},dZ.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),i=this._container=eu(dZ.HTML_MARKUP);n.appendChild(i),X(n).add(dK+"shown"),er(i,dq,"click",function(t){if(ea(t.delegateTarget,dW))return e.toggle(
vendor: 11,087 bytes, lines 380-383
380);e.trigger("click",t)}),en.bind(i,"mousedown",function(e){e.stopPropagation()}),er(i,dU,"dragstart",function(t){e.trigger("dragstart",t)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:i})},dZ.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},dZ.prototype._toggleState=function(e){e=e||{};var t,n=this._getParentContainer(),i=this._container,r=this._eventBus,o=X(i),a=X(n);t="twoColumn"in e?e.twoColumn:this._needsCollapse(n.clientHeight,this._entries||{}),o.toggle(dX,t),a.toggle(dK+dX,t),"open"in e&&(o.toggle(dY,e.open),a.toggle(dK+dY,e.open)),r.fire("palette.changed",{twoColumn:t,open:this.isOpen()})},dZ.prototype._update=function(){var e=es(".djs-palette-entries",this._container),t=this._entries=this.getEntries();J(e),R(t,function(t,n){var i,r,o,a=t.group||"default",s=es("[data-group="+rd(a)+"]",e);s||(K(s=eu('<div class="group"></div>'),"data-group",a),e.appendChild(s));var c=eu(t.html||(t.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'));if(s.appendChild(c),!t.separator&&(K(c,"data-action",n),t.title&&(K(c,"aria-label",t.title),K(c,"role","button")),t.className&&(i=c,r=t.className,o=X(i),(v(r)?r:r.split(/\s+/g)).forEach(function(e){o.add(e)})),t.imageUrl)){var l=eu("<img>");K(l,"src",t.imageUrl),c.appendChild(l)}}),this.open()},dZ.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=K(o,"data-action"),r=t.originalEvent||t,this.triggerEntry(i,e,r,n)):t.preventDefault()},dZ.prototype.triggerEntry=function(e,t,n,i){var r,o;if((r=this._entries[e])&&(o=r.action,!1!==this._eventBus.fire("palette.trigger",{entry:r,event:n}))){if(x(o)){if("click"===t)return o(n,i)}else if(o[t])return o[t](n,i);n.preventDefault()}},dZ.prototype._layoutChanged=function(){this._toggleState({})},dZ.prototype._needsCollapse=function(e,t){return e<46*Object.keys(t).length+50},dZ.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},dZ.prototype.open=function(){this._toggleState({open:!0})},dZ.prototype.toggle=function(){this.isOpen()?this.close():this.open()},dZ.prototype.isActiveTool=function(e){return e&&this._activeTool===e},dZ.prototype.updateToolHighlight=function(e){var t;this._toolsContainer||(t=es(".djs-palette-entries",this._container),this._toolsContainer=es("[data-group=tools]",t)),R(this._toolsContainer.children,function(t){var n=t.getAttribute("data-action");if(n){var i=X(t);n=n.replace("-tool",""),i.contains("entry")&&n===e?i.add("highlighted-entry"):i.remove("highlighted-entry")}})},dZ.prototype.isOpen=function(){return X(this._container).has(dY)},dZ.prototype._getParentContainer=function(){return this._canvas.getContainer()},dZ.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>',d0.$inject=["eventBus","palette","hoverTooltip"],d0.prototype._init=function(e){this._updateEntries(),this._hoverTooltip.add({container:e,selector:".djs-palette-entries .entry",getContent:e=>{let t=this._entries[K(e,"data-action")];return t&&t.title?oA`<${dQ} 381 title=${t.title} 382 shortcut=${t.shortcut} 383 />`:null},getPosition:e=>{let t=e.getBoundingClientRect();return{x:t.right+8,y:t.top+t.height/2,placement:"right"}}})},d0.prototype._updateEntries=function(){this._entries=this._palette.getEntries()};var d1="crosshair",d2="selected";function d5(e,t,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var s=this,c={create:function(e){var n=t.getActiveLayer(),i=e.frame=ek("rect");eg(i,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),ed(n,i),l(!0),this.update(e)},update:function(e){var n=e.frame,i=e.bbox;n&&i&&eg(n,{x:i.x,y:i.y,width:i.width,height:i.height});var r=e.marked,o=e.lastMarked;if(r&&o){for(let e of o)r.has(e)||t.removeMarker(e,d2);for(let e of r)o.has(e)||t.addMarker(e,d2)}},remove:function(e){this.update(e),e.frame&&eO(e.frame),l(!1)}};function l(e){ev(t.getContainer()).toggle("djs-dragging-active-lasso",e)}o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(t){var n=t.originalEvent.target;(t.hover||n instanceof SVGElement)&&e.once("lasso.selection.ended",function(){s.activateLasso(t.originalEvent,!0)})}),e.on("lasso.end",0,function(e){var t=e.context;s._select(Array.from(t.marked))}),e.on("lasso.start",function(e){var t=e.context;t.bbox=d3(e),t.add=rD(e),t.lastMarked=new Set(r.get()),t.add?t.marked=t.lastMarked:t.marked=new Set,t.initialMarked=t.marked,c.create(t)}),e.on("lasso.move",function(e){var t,n=e.context,r=(t=n.bbox=d3(e),new Set(D(e5(i.getAll(),t)))),o=n.initialMarked.union(r);n.lastMarked=n.marked,n.marked=o,c.update(n)}),e.on("lasso.cleanup",function(e){var t=e.context;t.lastMarked=t.marked,t.marked=new Set(r.get()),c.remove(e.context)}),e.on("element.mousedown",1500,function(e){if(rD(e))return s.activateLasso(e.originalEvent),!0})}function d3(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y};return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?{x:t.x,y:t.y,width:n.x-t.x,height:n.y-t.y}:t.x>=n.x&&t.y<n.y||t.x>n.x&&t.y<=n.y?{x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x<n.x&&t.y>=n.y?{x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?{x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:{x:n.x,y:n.y,width:0,height:0}}d5.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],d5.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:d1,data:{context:{}},keepSelection:!0})},d5.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:d1,data:{context:{}},keepSelection:!0})},d5.prototype._select=function(e){this._selection.select(e)},d5.prototype.select=function(e,t,n=[]){var i=D(e5(e,t));this._select([...n,...i])},d5.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},d5.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};var d6="grab";function d9(e,t,n,i,r,o){this._dragging=n,this._mouse=o;var a=this,s=i.get("keyboard",!1);r.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",1500,function(e){if(rB(e))return a.activateMove(e.originalEvent,!0),!1}),s&&s.addListener(1500,function(e){if(!(!d4(e.keyEvent)||a.isActive())){var t=a._mouse.getLastMoveEvent();a.activateMove(t,!!t)}},"keyboard.keydown"),s&&s.addListener(1500,function(e){d4(e.keyEvent)&&a.isActive()&&a.toggle()},"keyboard.keyup"),e.on("hand.end",function(t){var n=t.originalEvent.target;if(!t.hover&&!(n instanceof SVGElement))return!1;e.once("hand.ended",function(){a.activateMove(t.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(e){var n=t.viewbox().scale;t.scroll({dx:e.dx*n,dy:e.dy*n})}),e.on("hand.move.end",function(t){var n=t.context.reactivate;return!rB(t)&&n&&e.once("hand.move.ended",function(e){a.activateHand(e.originalEvent,!0,!0)}),!1})}function d4(e){return r1("Space",e)}d9.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],d9.prototype.activateMove=function(e,t,n){"object"==typeof t&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:d6,data:{context:n||{}}})},d9.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:d6,data:{context:{reactivate:n}}})},d9.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},d9.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^(hand|hand\.move)$/.test(e.prefix)};var d8="connect-ok",d7="connect-not-ok";function fe(e,t,n,i,r,o,a){var s=this;this._dragging=t,this._rules=o,this._mouse=a,r.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(e){var t=e.context,n=e.hover,r=t.canStartConnect=s.canStartConnect(n);null!==r&&(t.startTarget=n,i.addMarker(n,r?d8:d7))}),e.on(["global-connect.out","global-connect.cleanup"],function(e){var t=e.context.startTarget,n=e.context.canStartConnect;t&&i.removeMarker(t,n?d8:d7)}),e.on(["global-connect.ended"],function(t){var i=t.context.startTarget,r={x:t.x,y:t.y};if(s.canStartConnect(i))return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,i,r)}),!1})}function ft(e,t,n,i,r,o,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=a,this._translate=s,e.registerProvider(this)}fe.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],fe.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},fe.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},fe.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},fe.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})},ft.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],ft.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,i=this._spaceTool,r=this._lassoTool,o=this._handTool,a=this._globalConnect,s=this._translate;function c(e,i,r,o,a){function s(i){var r=n.createShape(G({type:e},a));t.start(i,r)}return{group:i,className:r,title:o,action:{dragstart:s,click:s}}}function l(e){var i=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),r=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:i});t.start(e,[i,r],{hints:{autoSelect:[i]}})}function p(e){t.start(e,n.createParticipantShape())}return G(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:s("Activate hand tool"),shortcut:de.handTool.key,action:{click:function(e){o.activateHand(e)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:s("Activate lasso tool"),shortcut:de.lassoTool.key,action:{click:function(e){r.activateSelection(e)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:s("Activate create/remove space tool"),shortcut:de.spaceTool.key,action:{click:function(e){i.activateSelection(e)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:s("Activate global connect tool"),shortcut:de.globalConnectTool.key,action:{click:function(e){a.start(e)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":c("bpmn:StartEvent","event","bpmn-icon-start-event-none",s("Create start event")),"create.intermediate-event":c("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",s("Create intermediate/boundary event")),"create.end-event":c("bpmn:EndEvent","event","bpmn-icon-e
383nd-event-none",s("Create end event")),"create.exclusive-gateway":c("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",s("Create gateway")),"create.task":c("bpmn:Task","activity","bpmn-icon-task",s("Create task")),"create.data-object":c("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",s("Create data object reference")),"create.data-store":c("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",s("Create data store reference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:s("Create expanded sub-process"),action:{dragstart:l,click:l}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:s("Create pool/participant"),action:{dragstart:p,click:p}},"create.group":c("bpmn:Group","artifact","bpmn-icon-group",s("Create group"))}),e};let fn={__depends__:[{__depends__:[{__init__:["hoverTooltip"],hoverTooltip:["type",dG]}],__init__:["palette","paletteTooltip"],palette:["type",dZ],paletteTooltip:["type",d0]},lJ,pS,{__depends__:[pl,l0],__init__:["lassoTool"],lassoTool:["type",d5]},{__depends__:[pl,l0],__init__:["handTool"],handTool:["type",d9]},{__depends__:[si,ay,af,pl,l0],globalConnect:["type",fe]},i4],__init__:["paletteProvider"],paletteProvider:["type",ft]};function fi(e,t,n,i,r){rp.call(this,e),e.on("shape.move.move",250,function(e){var o,a=e.context,s=a.canExecute;(a.visualReplacements||(a.visualReplacements={}),s&&s.replacements)?R(a.canExecute.replacements,function(e){var o=e.oldElementId,s={type:e.newElementType};if(!a.visualReplacements[o]){var c=t.get(o);G(s,{x:c.x,y:c.y});var l=n.createShape(s);i.addShape(l,c.parent);var p=es('[data-element-id="'+rd(c.id)+'"]',a.dragGroup);p&&eg(p,{display:"none"});var u=r.addDragger(l,a.dragGroup);a.visualReplacements[o]=u,i.removeShape(l)}}):R(o=a.visualReplacements,function(e,t){var n=es('[data-element-id="'+rd(t)+'"]',a.dragGroup);n&&eg(n,{display:"inline"}),e.remove(),o[t]&&delete o[t]})})}fi.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],i(fi,rp);var fr=["x","y"],fo=Math.abs;function fa(e){e.on(["connect.hover","connect.move","connect.end"],1250,function(e){var t,n,i,r,o,a,s,c,l=e.context,p=l.canExecute,u=l.start,h=l.hover,d=l.source,f=l.target;!(e.originalEvent&&r0(e.originalEvent))&&(l.initialConnectionStart||(l.initialConnectionStart=l.connectionStart),p&&h&&(t=e,n=h,i=iu(h,"bpmn:Task")?10:20,fr.forEach(function(e){var r=fc(e,n);t[e]<n[e]+i?a5(t,e,n[e]+i):t[e]>n[e]+r-i&&a5(t,e,n[e]+r-i)})),h&&(r=p,M(["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"],function(e){return r&&r.type===e}))?(l.connectionStart=a1(u),ih(h,["bpmn:Event","bpmn:Gateway"])&&fs(e,a1(h)),ih(h,["bpmn:Task","bpmn:SubProcess"])&&(o=e,s=a1(a=h),fr.forEach(function(e){var t,n,i;t=o,n=a,t[i=e]>n[i]+20&&t[i]<n[i]+fc(i,n)-20&&a5(o,e,s[e])})),iu(d,"bpmn:BoundaryEvent")&&f===d.host&&function(e){var t,n,i,r=e.context,o=r.source,a=r.target;if(n=(t=r).hover,i=t.source,!n||!i||n!==i){var s=a1(o),c=tN(s,a,-10),l=[];/top|bottom/.test(c)&&l.push("x"),/left|right/.test(c)&&l.push("y"),l.forEach(function(t){var n,i=e[t];40>fo(i-s[t])&&(n=i>s[t]?s[t]+40:s[t]-40,a5(e,t,n))})}}(e)):(c=p)&&"bpmn:MessageFlow"===c.type?(iu(u,"bpmn:Event")&&(l.connectionStart=a1(u)),iu(h,"bpmn:Event")&&fs(e,a1(h))):l.connectionStart=l.initialConnectionStart)})}function fs(e,t){a5(e,"x",t.x),a5(e,"y",t.y)}fa.$inject=["eventBus"];function fc(e,t){return"x"===e?t.width:t.height}function fl(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function fp(){this._snapValues={}}function fu(e,t,n){var i=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(e){i.initSnap(e)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],1250,function(e){var t=e.context,r=t.shape,o=t.snapContext,a=t.target;if(!(e.originalEvent&&r0(e.originalEvent))&&!a2(e)&&a){var s=o.pointsForTarget(a);s.initialized||((s=i.addSnapTargetPoints(s,r,a)).initialized=!0),n.snap(e,s)}}),t.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}function fh(e,t){t.invoke(fu,this),e.on(["create.move","create.end"],1500,fd),e.on(["create.move","create.end","shape.move.move","shape.move.end"],1500,function(e){var t,n,i,r,o,a,s=e.context,c=s.canExecute,l=s.target;c&&("attach"===c||c.attach)&&!a2(e)&&(t=e,r=tD(n=l),o=ls(t,n),i=(a=t.context.shape).parent?{x:0,y:0}:tO(a),/top/.test(o)?a5(t,"y",r.top-i.y):/bottom/.test(o)&&a5(t,"y",r.bottom-i.y),/left/.test(o)?a5(t,"x",r.left-i.x):/right/.test(o)&&a5(t,"x",r.right-i.x))})}function fd(e){var t=e.context.createConstraints;if(t){var n=t.top,i=t.right,r=t.bottom,o=t.left;(o&&o>=e.x||i&&i<=e.x)&&a5(e,"x",e.x),(n&&n>=e.y||r&&r<=e.y)&&a5(e,"y",e.y)}}function ff(e,t){return -1!==e.indexOf(t)}function fm(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}function fg(e,t){var n=this;e.on(["resize.start"],function(e){n.initSnap(e)}),e.on(["resize.move","resize.end"],1250,function(e){var i=e.context,r=i.shape,o=r.parent,a=i.direction,s=i.snapContext;if(!(e.originalEvent&&r0(e.originalEvent))&&!a2(e)){var c,l,p=s.pointsForTarget(o);p.initialized||((p=n.addSnapTargetPoints(p,r,o,a)).initialized=!0),("n"===(c=a)||"s"===c)&&a5(e,"x",e.x),("e"===(l=a)||"w"===l)&&a5(e,"y",e.y),t.snap(e,p)}}),e.on(["resize.cleanup"],function(){t.hide()})}function fy(e,t){var n=tO(e),i=tD(e),r={x:n.x,y:n.y};return -1!==t.indexOf("n")?r.y=i.top:-1!==t.indexOf("s")&&(r.y=i.bottom),-1!==t.indexOf("e")?r.x=i.right:-1!==t.indexOf("w")&&(r.x=i.left),r}function fv(e){this._canvas=e,this._asyncHide=H(V(this.hide,this),1e3)}function fb(e,t,n,i){this._open=!1,this._results={},this._eventMaps=[],this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._canvas=e,this._eventBus=t,this._selection=n,this._translate=i,this._container=this._getBoxHtml(),this._searchInput=es(fb.INPUT_SELECTOR,this._container),this._resultsContainer=es(fb.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}function f_(e,t,n){var i,r=(i="",t.forEach(function(e){var t=rm(e.value||e.matched||e.normal);e.match||e.matched?i+='<b class="'+fb.RESULT_HIGHLIGHT_CLASS+'">'+t+"</b>":i+=t}),""!==i?i:null),o=eu(n);o.innerHTML=r,e.appendChild(o)}function fx(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._search=i,t.registerProvider(this)}function fw(e){let{item:{element:t},tokens:n}=e;return{element:t,primaryTokens:n.label,secondaryTokens:n.id}}fl.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},fl.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,-1===this._snapLocations.indexOf(e)&&this._snapLocations.push(e)},fl.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},fl.prototype.getSnapLocations=function(){return this._snapLocations},fl.prototype.setSnapLocations=function(e){this._snapLocations=e},fl.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new fp).initDefaults(this._defaultSnaps),n},fp.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),-1===n.x.indexOf(t.x)&&n.x.push(t.x),-1===n.y.indexOf(t.y)&&n.y.push(t.y)},fp.prototype.snap=function(e,t,n,i){var r=this._snapValues[t];return r&&function(e,t,n){var i,r;for(i=0,n=void 0===n?10:n;i<t.length;
383i++)if(aZ((r=t[i])-e)<=n)return r}(e[n],r[n],i)},fp.prototype.initDefaults=function(e){var t=this;R(e||{},function(e,n){R(e,function(e){t.add(n,e)})})},fu.$inject=["elementRegistry","eventBus","snapping"],fu.prototype.initSnap=function(e){var t,n=this._elementRegistry,i=e.context,r=i.shape,o=i.snapContext;o||(o=i.snapContext=new fl);var a={x:(t=n.get(r.id)?a1(r,e):{x:e.x+a1(r).x,y:e.y+a1(r).y}).x-r.width/2,y:t.y-r.height/2},s={x:t.x+r.width/2,y:t.y+r.height/2};return o.setSnapOrigin("mid",{x:t.x-e.x,y:t.y-e.y}),tM(r)||(o.setSnapOrigin("top-left",{x:a.x-e.x,y:a.y-e.y}),o.setSnapOrigin("bottom-right",{x:s.x-e.x,y:s.y-e.y})),o},fu.prototype.addSnapTargetPoints=function(e,t,n){return R(this.getSnapTargets(t,n),function(n){if(tM(n)){tM(t)&&e.add("mid",a1(n));return}if(tA(n)){if(n.waypoints.length<3)return;R(n.waypoints.slice(1,-1),function(t){e.add("mid",t)});return}e.add("mid",a1(n))}),_(t.x)&&_(t.y)&&this._elementRegistry.get(t.id)&&e.add("mid",a1(t)),e},fu.prototype.getSnapTargets=function(e,t){return a3(t).filter(function(e){return!e.hidden})},i(fh,fu),fh.$inject=["eventBus","injector"],fh.prototype.initSnap=function(e){var t=fu.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return R(n.outgoing,function(n){var r=n.waypoints[0];r=r.original||r,t.setSnapOrigin(n.id+"-docking",fm(r,i,e))}),R(n.incoming,function(n){var r=n.waypoints[n.waypoints.length-1];r=r.original||r,t.setSnapOrigin(n.id+"-docking",fm(r,i,e))}),iu(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},fh.prototype.addSnapTargetPoints=function(e,t,n){fu.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n);R(i,function(n){var i,r;(iu(i=n,"bpmn:SubProcess")&&iA(i)||iu(i,"bpmn:Participant")||(r="bpmn:TextAnnotation",[t,n].every(function(e){return iu(e,r)})))&&(e.add("top-left",aQ(n)),e.add("bottom-right",a0(n)))});var r=this._elementRegistry;return R(t.incoming,function(n){if(r.get(t.id)){ff(i,n.source)||e.add("mid",tO(n.source));var o=n.waypoints[0];e.add(n.id+"-docking",o.original||o)}}),R(t.outgoing,function(n){if(r.get(t.id)){ff(i,n.target)||e.add("mid",tO(n.target));var o=n.waypoints[n.waypoints.length-1];e.add(n.id+"-docking",o.original||o)}}),iu(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},fh.prototype.getSnapTargets=function(e,t){return fu.prototype.getSnapTargets.call(this,e,t).filter(function(e){return!iu(e,"bpmn:Lane")})},fg.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new fl);var o=fy(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},fg.prototype.addSnapTargetPoints=function(e,t,n,i){return R(this.getSnapTargets(t,n),function(t){e.add("corner",a0(t)),e.add("corner",aQ(t))}),e.add("corner",fy(t,i)),e},fg.$inject=["eventBus","snapping"],fg.prototype.getSnapTargets=function(e,t){return a3(t).filter(function(t){var n,i;return n=t,i=e,n.host!==i&&!tA(t)&&!t.hidden&&!tM(t)})},fv.$inject=["canvas"],fv.prototype.snap=function(e,t){var n=e.context.snapContext,i=n.getSnapLocations(),r={x:a2(e,"x"),y:a2(e,"y")};R(i,function(i){var o=n.getSnapOrigin(i),a={x:e.x+o.x,y:e.y+o.y};if(R(["x","y"],function(e){var n;r[e]||void 0!==(n=t.snap(a,i,e,7))&&(r[e]={value:n,originValue:n-o[e]})}),r.x&&r.y)return!1}),this.showSnapLine("vertical",r.x&&r.x.value),this.showSnapLine("horizontal",r.y&&r.y.value),R(["x","y"],function(t){var n=r[t];b(n)&&a5(e,t,n.originValue)})},fv.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=ek("path");return eg(n,{d:"M0,0 L0,0"}),ev(n).add("djs-snap-line"),ed(t,n),{update:function(t){_(t)?"horizontal"===e?eg(n,{d:"M-100000,"+t+" L+100000,"+t,display:""}):eg(n,{d:"M "+t+",-100000 L "+t+", +100000",display:""}):eg(n,{display:"none"})}}},fv.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},fv.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},fv.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},fv.prototype.hide=function(){R(this._snapLines,function(e){e.update(
vendor: 6,389 bytes, lines 383-391
383)})},fb.$inject=["canvas","eventBus","selection","translate"],fb.prototype._bindEvents=function(){var e=this;function t(t,n,i,r){e._eventMaps.push({el:t,type:i,listener:er(t,n,i,r)})}t(document,"html","click",function(t){e.close(!1)}),t(this._container,fb.INPUT_SELECTOR,"click",function(e){e.stopPropagation(),e.delegateTarget.focus()}),t(this._container,fb.RESULT_SELECTOR,"mouseover",function(t){t.stopPropagation(),e._scrollToNode(t.delegateTarget),e._preselect(t.delegateTarget)}),t(this._container,fb.RESULT_SELECTOR,"click",function(t){t.stopPropagation(),e._select(t.delegateTarget)}),t(this._container,fb.INPUT_SELECTOR,"keydown",function(e){r1("ArrowUp",e)&&e.preventDefault(),r1("ArrowDown",e)&&e.preventDefault()}),t(this._container,fb.INPUT_SELECTOR,"keyup",function(t){if(r1("Escape",t))return e.close();if(r1("Enter",t)){var n=e._getCurrentResult();return n?e._select(n):e.close(!1)}return r1("ArrowUp",t)?e._scrollToDirection(!0):r1("ArrowDown",t)?e._scrollToDirection():void(!r1(["ArrowLeft","ArrowRight"],t)&&e._search(t.delegateTarget.value))})},fb.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){eo(e.el,e.type,e.listener)})},fb.prototype._search=function(e){var t=this;if(this._clearResults(),e.trim()){var n=this._searchProvider.find(e);if(!(n=n.filter(function(e){return!t._canvas.getRootElements().includes(e.element)})).length)return void this._selection.select(null);n.forEach(function(e){var n=e.element.id,i=t._createResultNode(e,n);t._results[n]={element:e.element,node:i}});var i=es(fb.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}},fb.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},fb.prototype._scrollToNode=function(e){if(e&&e!==this._getCurrentResult()){var t=e.offsetTop,n=this._resultsContainer.scrollTop,i=t-this._resultsContainer.clientHeight+e.clientHeight;t<n?this._resultsContainer.scrollTop=t:n<i&&(this._resultsContainer.scrollTop=i)}},fb.prototype._clearResults=function(){J(this._resultsContainer),this._results={},this._eventBus.fire("searchPad.cleared")},fb.prototype._getCurrentResult=function(){return es(fb.RESULT_SELECTED_SELECTOR,this._resultsContainer)},fb.prototype._createResultNode=function(e,t){var n=eu(fb.RESULT_HTML);return e.primaryTokens.length>0&&f_(n,e.primaryTokens,fb.RESULT_PRIMARY_HTML),f_(n,e.secondaryTokens,fb.RESULT_SECONDARY_HTML),K(n,fb.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},fb.prototype.registerProvider=function(e){this._searchProvider=e},fb.prototype.open=function(){if(!this._searchProvider)throw Error("no search provider registered");this.isOpen()||(this._cachedRootElement=this._canvas.getRootElement(),this._cachedSelection=this._selection.get(),this._cachedViewbox=this._canvas.viewbox(),this._selection.select(null),this._bindEvents(),this._open=!0,X(this._canvas.getContainer()).add("djs-search-open"),X(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},fb.prototype.close=function(e=!0){this.isOpen()&&(e&&(this._cachedRootElement&&this._canvas.setRootElement(this._cachedRootElement),this._cachedSelection&&this._selection.select(this._cachedSelection),this._cachedViewbox&&this._canvas.viewbox(this._cachedViewbox),this._eventBus.fire("searchPad.restored")),this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._unbindEvents(),this._open=!1,X(this._canvas.getContainer()).remove("djs-search-open"),X(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())},fb.prototype.toggle=function(){this.isOpen()?this.close():this.open()},fb.prototype.isOpen=function(){return this._open},fb.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&X(t).remove(fb.RESULT_SELECTED_CLASS);var n=K(e,fb.RESULT_ID_ATTRIBUTE),i=this._results[n].element;X(e).add(fb.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(i,{top:300}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},fb.prototype._select=function(e){var t=K(e,fb.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(n,{top:300}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},fb.prototype._getBoxHtml=function(){let e=eu(fb.BOX_HTML),t=es(fb.INPUT_SELECTOR,e);return t&&t.setAttribute("aria-label",this._translate("Search in diagram")),e},fb.CONTAINER_SELECTOR=".djs-search-container",fb.INPUT_SELECTOR=".djs-search-input input",fb.RESULTS_CONTAINER_SELECTOR=".djs-search-results",fb.RESULT_SELECTOR=".djs-search-result",fb.RESULT_SELECTED_CLASS="djs-search-result-selected",fb.RESULT_SELECTED_SELECTOR="."+fb.RESULT_SELECTED_CLASS,fb.RESULT_ID_ATTRIBUTE="data-result-id",fb.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",fb.BOX_HTML=`<div class="djs-search-container djs-scrollable"> 384 <div class="djs-search-input"> 385 <svg class="djs-search-icon" width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"> 386 <path fill-rule="evenodd" clip-rule="evenodd" d="M9.0325 8.5H9.625L13.3675 12.25L12.25 13.3675L8.5 9.625V9.0325L8.2975 8.8225C7.4425 9.5575 6.3325 10 5.125 10C2.4325 10 0.25 7.8175 0.25 5.125C0.25 2.4325 2.4325 0.25 5.125 0.25C7.8175 0.25 10 2.4325 10 5.125C10 6.3325 9.5575 7.4425 8.8225 8.2975L9.0325 8.5ZM1.75 5.125C1.75 6.9925 3.2575 8.5 5.125 8.5C6.9925 8.5 8.5 6.9925 8.5 5.125C8.5 3.2575 6.9925 1.75 5.125 1.75C3.2575 1.75 1.75 3.2575 1.75 5.125Z" fill="#22242A"/> 387 </svg> 388 <input type="text" spellcheck="false" /> 389 </div> 390 <div class="djs-search-results" /> 391</div>`,fb.RESULT_HTML='<div class="djs-search-result"></div>',fb.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',fb.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>',fx.$inject=["elementRegistry","searchPad","canvas","search"],fx.prototype.find=function(e){var t=this._canvas.getRootElements(),n=this._elementRegistry.filter(function(e){return!tM(e)&&!t.includes(e)});return this._search(n.map(e=>({element:e,label:i$(e),id:e.id})),e,{keys:["label","id"]}).map(fw)};let fE={width:36,height:50},fS={width:50,height:50};
391function fk(e,t,n){return ek("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}function fC(e,t){this._styles=t,e.registerProvider(this)}function fR(e,t){var n;return"bpmn:DataObjectReference"===t?n=fE:"bpmn:DataStoreReference"===t&&(n=fS),e.width===n.width&&e.height===n.height}function fP(e){iP.call(this,e)}fC.$inject=["outline","styles"],fC.prototype.getOutline=function(e){var t;let n=this._styles.cls("djs-outline",["no-fill"]);return tM(e)&&ij(e.labelTarget)?(eg(t=ek("rect"),G({x:-5,y:-5,rx:4,width:e.width+10,height:e.height+10},n)),t):tM(e)?void 0:(iu(e,"bpmn:Gateway")?(G((t=ek("rect")).style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),eg(t,G({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},n))):ih(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group","bpmn:CallActivity"])?eg(t=ek("rect"),G({x:-5,y:-5,rx:14,width:e.width+10,height:e.height+10},n)):iu(e,"bpmn:EndEvent")?eg(t=ek("circle"),G({cx:e.width/2,cy:e.height/2,r:e.width/2+5+1},n)):iu(e,"bpmn:Event")?eg(t=ek("circle"),G({cx:e.width/2,cy:e.height/2,r:e.width/2+5},n)):iu(e,"bpmn:DataObjectReference")&&fR(e,"bpmn:DataObjectReference")?t=fk("M44.7648 11.3263L36.9892 2.64074C36.0451 1.58628 34.5651 0.988708 33.1904 0.988708H5.98667C3.22688 0.988708 0.989624 3.34892 0.989624 6.26039V55.0235C0.989624 57.9349 3.22688 60.2952 5.98667 60.2952H40.966C43.7257 60.2952 45.963 57.9349 45.963 55.0235V14.9459C45.963 13.5998 45.6407 12.3048 44.7648 11.3263Z",{x:-6,y:-6},n):iu(e,"bpmn:DataStoreReference")&&fR(e,"bpmn:DataStoreReference")&&(t=fk("M1.03845 48.1347C1.03845 49.3511 1.07295 50.758 1.38342 52.064C1.69949 53.3938 2.32428 54.7154 3.56383 55.6428C6.02533 57.4841 10.1161 58.7685 14.8212 59.6067C19.5772 60.4538 25.1388 60.8738 30.6831 60.8738C36.2276 60.8738 41.7891 60.4538 46.545 59.6067C51.2504 58.7687 55.3412 57.4842 57.8028 55.6429C59.0424 54.7156 59.6673 53.3938 59.9834 52.064C60.2938 50.7579 60.3285 49.351 60.3285 48.1344V13.8415C60.3285 12.6249 60.2938 11.218 59.9834 9.91171C59.6673 8.58194 59.0423 7.2602 57.8027 6.33294C55.341 4.49168 51.2503 3.20723 46.545 2.36914C41.7891 1.522 36.2276 1.10204 30.6831 1.10205C25.1388 1.10206 19.5772 1.52206 14.8213 2.36923C10.1162 3.20734 6.02543 4.49183 3.5639 6.33314C2.32433 7.26038 1.69951 8.58206 1.38343 9.91181C1.07295 11.2179 1.03845 12.6247 1.03845 13.8411V48.1347Z",{x:-6,y:-6},n)),t)},fC.prototype.updateOutline=function(e,t){if(!tM(e))return ih(e,["bpmn:SubProcess","bpmn:Group"])?(eg(t,{width:e.width+10,height:e.height+10}),!0):!!ih(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])},i(fP,iP),fP.Viewer=rW,fP.NavigatedViewer=of,fP.prototype.createDiagram=function(){return this.importXML('<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://bpmn.io/schema/bpmn" id="Definitions_1"><bpmn:process id="Process_1" isExecutable="false"><bpmn:startEvent id="StartEvent_1"/></bpmn:process><bpmndi:BPMNDiagram id="BPMNDiagram_1"><bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"><bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"><dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/></bpmndi:BPMNShape></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></bpmn:definitions>')},fP.prototype._interactionModules=[rq,oe,os,od],fP.prototype._modelingModules=[{__depends__:[{__init__:["alignElements"],alignElements:["type",ob]},oS,oX],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",oJ],alignElementsMenuProvider:["type",o0],bpmnAlignElements:["type",o2]},ar,{__depends__:[af],__init__:["autoScroll"],autoScroll:["type",am]},{__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",aa],bpmnAutoResizeProvider:["type",ac]},{__depends__:[af,ay],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",aT],bendpointMove:["type",aN],bendpointMovePreview:["type",aG],connectionSegmentMove:["type",aX],bendpointSnapping:["type",a4]},si,{__init__:["connectionPreview"],connectionPreview:["type",sr]},hz,l7,lJ,{__depends__:[oX,{__init__:["distributeElements"],distributeElements:["type",hV]}],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",hG],distributeElementsMenuProvider:["type",hU]},{__depends__:[{__init__:["editorActions"],editorActions:["type",hK]}],editorActions:["type",hX]},h4,{__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",h8]},{__depends__:[r4],__init__:["keyboardBindings"],keyboardBindings:["type",h7]},{__depends__:[r4,rG],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",dc]},{__depends__:[rl,dy,hv],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",dv],labelEditingPreview:["type",dw]},{__depends__:[rG,dk],__init__:["labelLink"],labelLink:["type",dP]},hl,{__depends__:[{__init__:["tooltips"],tooltips:["type",dj]}],__init__:["modelingFeedback"],modelingFeedback:["type",dO]},{__depends__:[rL,rG,dk,ay,af,sl],__init__:["move","movePreview"],move:["type",dL],movePreview:["type",dV]},fn,{__depends__:[sl],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",fi]},dy,{__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",fu],resizeSnapping:["type",fg],snapping:["type",fv]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",fa],createMoveSnapping:["type",fh]},{__depends__:[{__depends__:[i4,rs,rG],searchPad:["type",fb]},oY],__init__:["bpmnSearch"],bpmnSearch:["type",fx]},{__depends__:[dk],__init__:["outlineProvider"],outlineProvider:["type",fC]}],fP.prototype._modules=[].concat(rW.prototype._modules,fP.prototype._interactionModules,fP.prototype._modelingModules)},36480(e,t,n){n.d(t,{FK:()=>C,Ob:()=>z,XX:()=>F,_3:()=>k,fF:()=>r,h:()=>E,uA:()=>R,v2:()=>function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(_(t)?t.some(function(t){e(t,n)}):n.push(t)),n}});var i,r,o,a,s,c,l,p,u,h,d,f,m,g,y={},v=[],b=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_=Array.isArray;function x(e,t){for(var n in t)e[n]=t[n];return e}function w(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function E(e,t,n){var r,o,a,s={};
vendor: 9,165 bytes, line 391
391for(a in t)"key"==a?r=t[a]:"ref"==a?o=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?i.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return S(e,s,r,o,null)}function S(e,t,n,i,a){var s={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==a?++o:a,__i:-1,__u:0};return null==a&&null!=r.vnode&&r.vnode(s),s}function k(){return{current:null}}function C(e){return e.children}function R(e,t){this.props=e,this.context=t}function P(e,t){if(null==t)return e.__?P(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?P(e):null}function A(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!M.__r++||s!=r.debounceRendering)&&((s=r.debounceRendering)||c)(M)}function M(){try{for(var e,t=1;a.length;)a.length>t&&a.sort(l),e=a.shift(),t=a.length,function(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,i=[],o=[],a=x({},t);a.__v=t.__v+1,r.vnode&&r.vnode(a),O(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,i,null==n?P(t):n,!!(32&t.__u),o),a.__v=t.__v,a.__.__k[a.__i]=a,L(i,a,o),t.__e=t.__=null,a.__e!=n&&function e(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some(function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e}),e(t)}(a)}}(e)}finally{a.length=M.__r=0}}function T(e,t,n,i,o,a,s,c,l,p,u){var h,d,f,m,g,b,x,E=i&&i.__k||v,k=t.length;for(l=function(e,t,n,i,o){var a,s,c,l,p,u=n.length,h=u,d=0;for(e.__k=Array(o),a=0;a<o;a++)null!=(s=t[a])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=e.__k[a]=S(null,s,null,null,null):_(s)?s=e.__k[a]=S(C,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=e.__k[a]=S(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[a]=s,l=a+d,s.__=e,s.__b=e.__b+1,c=null,-1!=(p=s.__i=function(e,t,n,i){var r,o,a,s=e.key,c=e.type,l=t[n],p=null!=l&&0==(2&l.__u);if(null===l&&null==s||p&&s==l.key&&c==l.type)return n;if(i>+!!p){for(r=n-1,o=n+1;r>=0||o<t.length;)if(null!=(l=t[a=r>=0?r--:o++])&&0==(2&l.__u)&&s==l.key&&c==l.type)return a}return -1}(s,n,l,h))&&(h--,(c=n[p])&&(c.__u|=2)),null==c||null==c.__v?(-1==p&&(o>u?d--:o<u&&d++),"function"!=typeof s.type&&(s.__u|=4)):p!=l&&(p==l-1?d--:p==l+1?d++:(p>l?d--:d++,s.__u|=4))):e.__k[a]=null;if(h)for(a=0;a<u;a++)null!=(c=n[a])&&0==(2&c.__u)&&(c.__e==i&&(i=P(c)),function e(t,n,i){var o,a;if(r.unmount&&r.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||$(o,null,n)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){r.__e(e,n)}o.base=o.__P=null}if(o=t.__k)for(a=0;a<o.length;a++)o[a]&&e(o[a],n,i||"function"!=typeof t.type);i||w(t.__e),t.__c=t.__=t.__e=void 0}(c,c));return i}(n,t,E,l,k),h=0;h<k;h++)null!=(f=n.__k[h])&&(d=-1!=f.__i&&E[f.__i]||y,f.__i=h,b=O(e,f,d,o,a,s,c,l,p,u),m=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&$(d.ref,null,f),u.push(f.ref,f.__c||m,f)),null==g&&null!=m&&(g=m),(x=!!(4&f.__u))||d.__k===f.__k?(l=function e(t,n,i,r){var o,a;if("function"==typeof t.type){for(o=t.__k,a=0;o&&a<o.length;a++)o[a]&&(o[a].__=t,n=e(o[a],n,i,r));return n}t.__e!=n&&(r&&(n&&t.type&&!n.parentNode&&(n=P(t)),i.insertBefore(t.__e,n||null)),n=t.__e);do n=n&&n.nextSibling;while(null!=n&&8==n.nodeType)return n}(f,l,e,x),x&&d.__e&&(d.__e=null)):"function"==typeof f.type&&void 0!==b?l=b:m&&(l=m.nextSibling),f.__u&=-7);return n.__e=g,l}function B(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||b.test(t)?n:n+"px"}function D(e,t,n,i,r){var o,a;t:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||B(e.style,t,"");if(n)for(t in n)i&&n[t]==i[t]||B(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(d,"$1")),t=(a=t.toLowerCase())in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n[h]=i[h]:(n[h]=f,e.addEventListener(t,o?g:m,o)):e.removeEventListener(t,o?g:m,o);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break t}catch{}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function j(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[u])t[u]=f++;else if(t[u]<n[h])return;return n(r.event?r.event(t):t)}}}function O(e,t,n,o,a,s,c,l,p,u){var h,d,f,m,g,b,E,S,k,A,M,B,j,O,L,$=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(p=!!(32&n.__u),s=[l=t.__e=n.__e]),(h=r.__b)&&h(t);t:if("function"==typeof $)try{if(S=t.props,k=$.prototype&&$.prototype.render,A=(h=$.contextType)&&o[h.__c],M=h?A?A.props.value:h.__:o,n.__c?E=(d=t.__c=n.__c).__=d.__E:(k?t.__c=d=new $(S,M):(t.__c=d=new R(S,M),d.constructor=$,d.render=I),A&&A.sub(d),d.state||(d.state={}),d.__n=o,f=d.__d=!0,d.__h=[],d._sb=[]),k&&null==d.__s&&(d.__s=d.state),k&&null!=$.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=x({},d.__s)),x(d.__s,$.getDerivedStateFromProps(S,d.__s))),m=d.props,g=d.state,d.__v=t,f)k&&null==$.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),k&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(k&&null==$.getDerivedStateFromProps&&S!==m&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(S,M),t.__v==n.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(S,d.__s,M)){t.__v!=n.__v&&(d.props=S,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),v.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&c.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(S,d.__s,M),k&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(m,g,b)})}if(d.context=M,d.props=S,d.__P=e,d.__e=!1,B=r.__r,j=0,k)d.state=d.__s,d.__d=!1,B&&B(t),h=d.render(d.props,d.state,d.context),v.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,B&&B(t),h=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++j<25)d.state=d.__s,null!=d.getChildContext&&(o=x(x({},o),d.getChildContext())),k&&!f&&null!=d.getSnapshotBeforeUpdate&&(b=d.getSnapshotBeforeUpdate(m,g)),O=null!=h&&h.type===C&&null==h.key?function e(t){return"object"!=typeof t||null==t||t.__b>0?t:_(t)?t.map(e):void 0!==t.constructor?null:x({},t)}(h.props.children):h,l=T(e,_(O)?O:[O],t,n,o,a,s,c,l,p,u),d.base=t.__e,t.__u&=-161,d.__h.length&&c.push(d),E&&(d.__E=d.__=null)}catch(e){if(t.__v=null,p||null!=s)if(e.then){for(t.__u|=p?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;s[s.indexOf(l)]=null,t.__e=l}else{for(L=s.length;L--;)w(s[L]);N(t)}else t.__e=n.__e,t.__k=n.__k,e.then||N(t);r.__e(e,t,n)}else null==s&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=function(e,t,n,o,a,s,c,l,p){var u,h,d,f,m,g,v,b=n.props||y,x=t.props,E=t.type;if("svg"==E?a="http://www.w3.org/2000/svg":"math"==E?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),null!=s){for(u=0;u<s.length;u++)if((m=s[u])&&"setAttribute"in m==!!E&&(E?m.localName==E:3==m.nodeType)){e=m,s[u]=null;break}}if(null==e){if(null==E)return document.createTextNode(x);e=document.createElementNS(a,E,x.is&&x),l&&(r.__m&&r.__m(t,s),l=!1),s=null}if(null==E)b===x||l&&e.data==x||(e.data=x);else{if(s="textarea"==E&&null!=x.defaultValue?null:s&&i.call(e.childNodes),!l&&null!=s)for(b={},u=0;u<e.attributes.length;u++)b[(m=e.attributes[u]).name]=m.value;for(u in b)m=b[u],"dangerouslySetInnerHTML"==u?d=m:"children"==u||u in x||"value"==u&&"defaultValue"in x||"checked"==u&&"defaultChecked"in x||D(e,u,null,m,a);for(u in x)m=x[u],"children"==u?f=m:"dangerouslySetInnerHTML"==u?h=m:"value"==u?g=m:"checked"==u?v=m:l&&"function"!=typeof m||b[u]===m||D(e,u,m,b[u],a);if(h)l||d&&(h.__html==d.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(d&&(e.innerHTML=""),T("template"==t.type?e.content:e,_(f)?f:[f],t,n,o,"foreignObject"==E?"http://www.w3.org/1999/xhtml":a,s,c,s?s[0]:n.__k&&P(n,0),l,p),null!=s)for(u=s.length;u--;)w(s[u]);l&&"textarea"!=E||(u="value","progress"==E&&null==g?e.removeAttribute("value"):null==g||g===e[u]&&("progress"!=E||g)&&("option"!=E||g==b[u])||D(e,u,g,b[u],a),u="checked",null!=v&&v!=e[u]&&D(e,u,v,b[u],a))}return e}(n.__e,t,n,o,a,s,c,p,u);return(h=r.diffed)&&h(t),128&t.__u?void 0:l}function N(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(N))}function L(e,t,n){for(var i=0;i<n.length;i++)$(n[i],n[++i],n[++i]);r.__c&&r.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){r.__e(e,t.__v)}})}function $(e,t,n){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){r.__e(e,n)}}function I(e,t,n){return this.constructor(e,n)}function F(e,t,n){var o,a,s,c;t==document&&(t=document.documentElement),r.__&&r.__(e,t),a=(o="function"==typeof n)?null:n&&n.__k||t.__k,s=[],c=[],O(t,e=(!o&&n||t).__k=E(C,null,[e]),a||y,y,t.namespaceURI,!o&&n?[n]:a?null:t.firstChild?i.call(t.childNodes):null,
vendor: 1,039 bytes, line 391
391s,!o&&n?n:a?a.__e:t.firstChild,o,c),L(s,e,c)}function z(e,t,n){var r,o,a,s,c=x({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==a?r=t[a]:"ref"==a?o=t[a]:c[a]=void 0===t[a]&&null!=s?s[a]:t[a];return arguments.length>2&&(c.children=arguments.length>3?i.call(arguments,2):n),S(e.type,c,r||e.key,o||e.ref,null)}i=v.slice,r={__e:function(e,t,n,i){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),a=r.__d),a)return r.__E=r}catch(t){e=t}throw e}},o=0,R.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=x({},this.state),"function"==typeof e&&(e=e(x({},n),this.props)),e&&x(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),A(this))},R.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),A(this))},R.prototype.render=C,a=[],c="function"==typeof Promise?Promise.prototype.then.bind(Prom
391ise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},M.__r=0,u="__d"+(p=Math.random().toString(8)),h="__a"+p,d=/(PointerCapture)$|Capture$/i,f=0,m=j(!1),g=j(!0)},51262(e,t,n){n.d(t,{J0:()=>v,Kr:()=>w,Nf:()=>_,hb:()=>E,li:()=>x,vJ:()=>b});var i,r,o,a,s=n(36480),c=0,l=[],p=s.fF,u=p.__b,h=p.__r,d=p.diffed,f=p.__c,m=p.unmount,g=p.__;function y(e,t){p.__h&&p.__h(r,e,c||t),c=0;var n=r.__H||(r.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function v(e){return c=1,function(e,t){var n=y(i++,2);if(n.t=e,!n.__c&&(n.__=[A(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],i=n.t(t,e);t!==i&&(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=r,!r.__f)){var o=function(e,t,i){if(!n.__c.__H)return!0;var r=n.__c.__H.__.filter(function(e){return e.__c});if(r.every(function(e){return!e.__N}))return!a||a.call(this,e,t,i);var o=n.__c.props!==e;return r.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a&&a.call(this,e,t,i)||o};r.__f=!0;var a=r.shouldComponentUpdate,s=r.componentWillUpdate;r.componentWillUpdate=function(e,t,n){if(this.__e){var i=a;a=void 0,o(e,t,n),a=i}s&&s.call(this,e,t,n)},r.shouldComponentUpdate=o}return n.__N||n.__}(A,e)}function b(e,t){var n=y(i++,3);!p.__s&&P(n.__H,t)&&(n.__=e,n.u=t,r.__H.__h.push(n))}function _(e,t){var n=y(i++,4);!p.__s&&P(n.__H,t)&&(n.__=e,n.u=t,r.__h.push(n))}function x(e){return c=5,w(function(){return{current:e}},[])}function w(e,t){var n=y(i++,7);return P(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function E(e,t){return c=8,w(function(){return e},t)}function S(){for(var e;e=l.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(C),t.__h.some(R),t.__h=[]}catch(n){t.__h=[],p.__e(n,e.__v)}}}p.__b=function(e){r=null,u&&u(e)},p.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),g&&g(e,t)},p.__r=function(e){h&&h(e),i=0;var t=(r=e.__c).__H;t&&(o===r?(t.__h=[],r.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(C),t.__h.some(R),t.__h=[],i=0)),o=r},p.diffed=function(e){d&&d(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==l.push(t)&&a===p.requestAnimationFrame||((a=p.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(i),k&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,35);k&&(t=requestAnimationFrame(n))})(S)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),o=r=null},p.__c=function(e,t){t.some(function(e){try{e.__h.some(C),e.__h=e.__h.filter(function(e){return!e.__||R(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],p.__e(n,e.__v)}}),f&&f(e,t)},p.unmount=function(e){m&&m(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{C(e)}catch(e){t=e}}),n.__H=void 0,t&&p.__e(t,n.__v))};var k="function"==typeof requestAnimationFrame;function C(e){var t=r,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),r=t}function R(e){var t=r;e.__c=e.__(),r=t}function P(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function A(e,t){return"function"==typeof t?t(e):t}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.