bpmn-embedded-5MwZRcjj.js 814 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. import{_ as Nc}from"./Dialog.vue_vue_type_style_index_0_lang-pGfk6adK.js";import{O as vx,Q as Vr,a6 as yx,b$ as vh,b as on,I as $r,C as yh,F as Ic,m as Nt,k as Cn,l as kn,o as Mo,aQ as Bc,_ as gx,b0 as bx,a0 as gh,p as an,A as Jt,q as gi,s as bi,v as bh,j as Dc,bg as tr,c0 as xx,a1 as xh,D as Oc,Y as _x,Z as Ex,c1 as wx,c2 as Sx,c3 as Cx,e as kx}from"./index-CKIhG1T4.js";import{_ as Ax}from"./XTextButton-BNUFIHXa.js";import{_ as Jn}from"./XButton-BAATZZ7c.js";import{c as Tx,g as Px,a as Rx}from"./spreadSheetsDesignerResourcesCn-afJmEehS.js";import{C as et,a as F,w as qe,f as Fr,v as nr,M as An,D as W,E as pe,F as me,Q as Mx,K as Le,$ as T,U as D,u as A,T as re,Y as fe,Z as ce,_ as sn,V as xi,c as ze,P as Lc,as as _h,i as ln,n as it,ad as We,an as Nx,aC as Ix,t as Te,ap as Eh,aq as wh,X as Sh,b as jc,a0 as Ja,a4 as Bx}from"./spreadSheetsDesignerVue-MRUT1X_l.js";import{F as _i,A as Ch,a as Dx,R as Ox,b as Lx,c as jx,d as Vx,e as $x,O as kh,D as Fx,T as ir,f as zx,g as Ux,C as Ue,h as Hx,M as Gx,i as rr,j as Wx}from"./consts-D1oA9NoR.js";import{g as Ah}from"./index-UbfkDtIu.js";import{u as Th,c as Ph}from"./utils-Bylg6CZi.js";import{a as qx}from"./index-B05rghZm.js";import{E as Kx}from"./el-tree-select-Jn0wedJD.js";import{h as Xx,d as Yx}from"./tree-CWCwWKDc.js";import{g as Jx}from"./index-CVcjhaU3.js";import{g as Zx}from"./index-BP9cMaSk.js";import{g as Qx}from"./index-B2iR2Mmq.js";import{g as e_}from"./index-D6Dtt_1V.js";import{_ as Rh}from"./ContentWrap.vue_vue_type_script_setup_true_lang-Dr2ObOZ6.js";import{_ as Mh}from"./index.vue_vue_type_script_setup_true_lang-DFNSD-eX.js";import{C as Nh,b as Vc}from"./constants-CsKXDkTX.js";import{P as t_}from"./index-B_bhuOS7.js";import{E as Ih}from"./el-drawer-CG4e3nfG.js";import{_ as Bh}from"./DictTag.vue_vue_type_script_lang-DQpfYj_J.js";import{P as n_}from"./index-CHYzcHvN.js";import{d as Dh,a as i_}from"./formatTime-GfXNJyvM.js";function le(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}var Oh,Lh,r_=(Oh=function(e){var t=e.exports=function(n,i){if(i||(i=16),n===void 0&&(n=128),n<=0)return"0";for(var r=Math.log(Math.pow(2,n))/Math.log(i),o=2;r===1/0;o*=2)r=Math.log(Math.pow(2,n/o))/Math.log(i)*o;var a=r-Math.floor(r),s="";for(o=0;o<Math.floor(r);o++)s=Math.floor(Math.random()*i).toString(i)+s;if(a){var c=Math.pow(i,a);s=Math.floor(Math.random()*c).toString(i)+s}var u=parseInt(s,i);return u!==1/0&&u>=Math.pow(2,n)?t(n,i):s};t.rack=function(n,i,r){var o=function(s){var c=0;do{if(c++>10){if(!r)throw new Error("too many ID collisions, use more bits");n+=r}var u=t(n,i)}while(Object.hasOwnProperty.call(a,u));return a[u]=s,u},a=o.hats={};return o.get=function(s){return o.hats[s]},o.set=function(s,c){return o.hats[s]=c,o},o.bits=n||128,o.base=i||16,o}},Oh(Lh={exports:{}}),Lh.exports);function Vn(e){if(!(this instanceof Vn))return new Vn(e);e=e||[128,36,1],this._seed=e.length?r_.rack(e[0],e[1],e[2]):e}function $c(e){return Array.prototype.concat.apply([],e)}Vn.prototype.next=function(e){return this._seed(e||!0)},Vn.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n},Vn.prototype.claim=function(e,t){this._seed.set(e,t||!0)},Vn.prototype.assigned=function(e){return this._seed.get(e)||!1},Vn.prototype.unclaim=function(e){delete this._seed.hats[e]},Vn.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};const No=Object.prototype.toString,o_=Object.prototype.hasOwnProperty;function or(e){return e===void 0}function xt(e){return e!==void 0}function Io(e){return e==null}function Ee(e){return No.call(e)==="[object Array]"}function vt(e){return No.call(e)==="[object Object]"}function ye(e){return No.call(e)==="[object Number]"}function rt(e){const t=No.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function Ut(e){return No.call(e)==="[object String]"}function Lt(e,t){return!Io(e)&&o_.call(e,t)}function Be(e,t){const n=Qa(t);let i;return $(e,function(r,o){if(n(r,o))return i=r,!1}),i}function jh(e,t){const n=Qa(t);let i=Ee(e)?-1:void 0;return $(e,function(r,o){if(n(r,o))return i=o,!1}),i}function Ce(e,t){const n=Qa(t);let i=[];return $(e,function(r,o){n(r,o)&&i.push(r)}),i}function $(e,t){let n,i;if(or(e))return;const r=Ee(e)?l_:s_;for(let o in e)if(Lt(e,o)&&(n=e[o],i=t(n,r(o)),i===!1))return n}function Ht(e,t,n){return $(e,function(i,r){n=t(n,i,r)}),n}function ar(e,t){return!!Ht(e,function(n,i,r){return n&&t(i,r)},!0)}function Gt(e,t){return!!Be(e,t)}function kt(e,t){let n=[];return $(e,function(i,r){n.push(t(i,r))}),n}function Za(e){return e&&Object.keys(e)||[]}function Fc(e){return kt(e,t=>t)}function zr(e,t,n={}){return t=zc(t),$(e,function(i){let r=t(i)||"_",o=n[r];o||(o=n[r]=[]),o.push(i)}),n}function Vh(e,...t){e=zc(e);let n={};return $(t,i=>zr(i,e,n)),kt(n,function(i,r){return i[0]})}const a_=Vh;function $n(e,t){t=zc(t);let n=[];return $(e,function(i,r){let o=t(i,r),a={d:o,v:i};for(var s=0;s<n.length;s++){let{d:c}=n[s];if(o<c)return void n.splice(s,0,a)}n.push(a)}),kt(n,i=>i.v)}function Tn(e){return function(t){return ar(e,function(n,i){return t[i]===n})}}function zc(e){return rt(e)?e:t=>t[e]}function Qa(e){return rt(e)?e:t=>t===e}function s_(e){return e}function l_(e){return Number(e)}function $h(e,t){let n,i,r,o;function a(p){let d=Date.now(),m=p?0:o+t-d;if(m>0)return s(m);e.apply(r,i),c()}function s(p){n=setTimeout(a,p)}function c(){n&&clearTimeout(n),n=o=i=r=void 0}function u(...p){o=Date.now(),i=p,r=this,n||s(t)}return u.flush=function(){n&&a(!0),c()},u.cancel=c,u}function jt(e,t){return e.bind(t)}function z(e,...t){return Object.assign(e,...t)}function Pn(e,t){let n={},i=Object(e);return $(t,function(r){r in i&&(n[r]=e[r])}),n}function cn(e,t){let n={};return $(Object(e),function(i,r){t.indexOf(r)===-1&&(n[r]=i)}),n}function c_(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(i){if(i!=="default"&&!(i in e)){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}})}),Object.freeze(e)}const u_=Object.prototype.toString,p_=Object.prototype.hasOwnProperty;function d_(e,t){return p_.call(e,t)}function Fh(e,t){let n,i;if(e===void 0)return;const r=(o=e,u_.call(o)==="[object Array]"?m_:h_);var o;for(let a in e)if(d_(e,a)&&(n=e[a],i=t(n,r(a)),i===!1))return n}function h_(e){return e}function m_(e){return Number(e)}function At(e,...t){const n=e.style;return Fh(t,function(i){i&&Fh(i,function(r,o){n[o]=r})}),e}function It(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}const f_=Object.prototype.toString;function Ke(e){return new Ei(e)}function Ei(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function es(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Zn(e,t,n){var i=n?e:e.parentNode;return i&&typeof i.closest=="function"&&i.closest(t)||null}Ei.prototype.add=function(e){return this.list.add(e),this},Ei.prototype.remove=function(e){return f_.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},Ei.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Ei.prototype.toggle=function(e,t){return t!==void 0?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Ei.prototype.array=function(){return Array.from(this.list)},Ei.prototype.has=Ei.prototype.contains=function(e){return this.list.contains(e)};var ts,Uc,Hc,ns={};function zh(){ts=window.addEventListener?"addEventListener":"attachEvent",Uc=window.removeEventListener?"removeEventListener":"detachEvent",Hc=ts!=="addEventListener"?"on":""}var Gc,v_=ns.bind=function(e,t,n,i){return ts||zh(),e[ts](Hc+t,n,i||!1),n},y_=ns.unbind=function(e,t,n,i){return Uc||zh(),e[Uc](Hc+t,n,i||!1),n},ve=c_({__proto__:null,bind:v_,unbind:y_,default:ns},[ns]),Uh=["focus","blur"],un=function(e,t,n,i,r){return Uh.indexOf(n)!==-1&&(r=!0),ve.bind(e,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=Zn(a,t,!0),o.delegateTarget&&i.call(e,o)},r)},Hh=function(e,t,n,i){return Uh.indexOf(t)!==-1&&(i=!0),ve.unbind(e,t,n,i)},Gh=!1;typeof document<"u"&&((Gc=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Gh=!Gc.getElementsByTagName("link").length,Gc=void 0);var pt={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:Gh?[1,"X<div>","</div>"]:[0,"",""]};pt.td=pt.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],pt.option=pt.optgroup=[1,'<select multiple="multiple">',"</select>"],pt.thead=pt.tbody=pt.colgroup=pt.caption=pt.tfoot=[1,"<table>","</table>"],pt.polyline=pt.ellipse=pt.polygon=pt.circle=pt.text=pt.line=pt.path=pt.rect=pt.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var He=function(e,t){if(typeof e!="string")throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if(i=="body")return(r=t.createElement("html")).innerHTML=e,r.removeChild(r.lastChild);var r,o=Object.prototype.hasOwnProperty.call(pt,i)?pt[i]:pt._default,a=o[0],s=o[1],c=o[2];for((r=t.createElement("div")).innerHTML=s+e+c;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var u=t.createDocumentFragment();r.firstChild;)u.appendChild(r.removeChild(r.firstChild));return u};function is(e,t){return e&&typeof e.matches=="function"&&e.matches(t)||!1}function Ve(e,t){return(t=t||document).querySelector(e)}function Wc(e,t){return(t=t||document).querySelectorAll(e)}function Fn(e){e.parentNode&&e.parentNode.removeChild(e)}function xe(e,t){return function(n,i){i.appendChild(function(r,o){if(r.ownerDocument!==o.ownerDocument)try{return o.ownerDocument.importNode(r,!0)}catch{}return r}(n,i))}(t,e),e}var Wh={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":2,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function qh(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=Wh[i];r?(r===2&&typeof n=="number"&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function ae(e,t,n){if(typeof t=="string"){if(n===void 0)return function(i,r){return Wh[r]?i.style[r]:i.getAttributeNS(null,r)}(e,t);qh(e,t,n)}else(function(i,r){var o,a,s=Object.keys(r);for(o=0;a=s[o];o++)qh(i,a,r[a])})(e,t);return e}const g_=Object.prototype.toString;function Pe(e){return new wi(e)}function wi(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function rs(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Kh(e){return e.cloneNode(!0)}wi.prototype.add=function(e){return this.list.add(e),this},wi.prototype.remove=function(e){return g_.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},wi.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},wi.prototype.toggle=function(e,t){return t!==void 0?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},wi.prototype.array=function(){return Array.from(this.list)},wi.prototype.has=wi.prototype.contains=function(e){return this.list.contains(e)};var qc="http://www.w3.org/2000/svg",Xh='<svg xmlns="'+qc+'"';function ue(e,t){var n;return(e=e.trim()).charAt(0)==="<"?(n=function(i){var r=!1;i.substring(0,4)==="<svg"?i.indexOf(qc)===-1&&(i=Xh+i.substring(4)):(i=Xh+">"+i+"</svg>",r=!0);var o=function(c){var u;return(u=new DOMParser).async=!1,u.parseFromString(c,"text/xml")}(i);if(!r)return o;for(var a=document.createDocumentFragment(),s=o.firstChild;s.firstChild;)a.appendChild(s.firstChild);return a}(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(qc,e),t&&ae(n,t),n}var Kc=null;function Yh(){return Kc===null&&(Kc=ue("svg")),Kc}function Jh(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function Bo(e){return Yh().createSVGTransform()}var Zh=/([&<>]{1})/g,b_=/([&<>\n\r"]{1})/g,x_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function Xc(e,t){return e.replace(t,function(n,i){return x_[i]||i})}function Qh(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(Xc(e.textContent,Zh));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n<i;++n)o=r.item(n),t.push(" ",o.name,'="',Xc(o.value,b_),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(a=e.childNodes).length;n<i;++n)Qh(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",Xc(e.nodeValue,Zh),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function em(e,t){return function(n){for(var i=n.firstChild,r=[];i;)Qh(i,r),i=i.nextSibling;return r.join("")}(e)}function dt(e){var t=e.parentNode;return t&&t.removeChild(e),e}function __(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Do(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(i,r){var o,a;for(i.clear(),o=0;a=r[o];o++)i.appendItem(__(i,a))}(n,t)),n.consolidate()}const E_=/^class[ {]/;function Yc(e){return Array.isArray(e)}function Jc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function os(...e){e.length===1&&Yc(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const w_=/constructor\s*[^(]*\(\s*([^)]*)\)/m,S_=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,C_=/\/\*([^*]*)\*\//m;function k_(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(function(i){return E_.test(i.toString())}(e)?w_:S_);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map(i=>{const r=i.match(C_);return(r&&r[1]||i).trim()})||[]}function tm(e,t){const n=t||{get:function(b,w){if(i.push(b),w===!1)return null;throw s(`No provider for "${b}"!`)}},i=[],r=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(b){const w=i.join(" -> ");return i.length=0,new Error(w?`${b} (Resolving: ${w})`:b)};function c(b,w){if(!r[b]&&b.includes(".")){const S=b.split(".");let k=c(S.shift());for(;S.length;)k=k[S.shift()];return k}if(Jc(o,b))return o[b];if(Jc(r,b)){if(i.indexOf(b)!==-1)throw i.push(b),s("Cannot resolve circular dependency!");return i.push(b),o[b]=r[b][0](r[b][1]),i.pop(),o[b]}return n.get(b,w)}function u(b,w){if(w===void 0&&(w={}),typeof b!="function"){if(!Yc(b))throw s(`Cannot invoke "${b}". Expected a function!`);b=os(b.slice())}return{fn:b,dependencies:(b.$inject||k_(b)).map(S=>Jc(w,S)?w[S]:c(S))}}function p(b){const{fn:w,dependencies:S}=u(b);return new(Function.prototype.bind.call(w,null,...S))}function d(b,w,S){const{fn:k,dependencies:l}=u(b,S);return k.apply(w,l)}function m(b){return os(w=>b.get(w))}function f(b,w){if(w&&w.length){const S=Object.create(null),k=Object.create(null),l=[],h=[],y=[];let x,C,N,O;for(let B in r)x=r[B],w.indexOf(B)!==-1&&(x[2]==="private"?(C=l.indexOf(x[3]),C===-1?(N=x[3].createChild([],w),O=m(N),l.push(x[3]),h.push(N),y.push(O),S[B]=[O,B,"private",N]):S[B]=[y[C],B,"private",h[C]]):S[B]=[x[2],x[1]],k[B]=!0),x[2]!=="factory"&&x[2]!=="type"||!x[1].$scope||w.forEach(H=>{x[1].$scope.indexOf(H)!==-1&&(S[B]=[x[2],x[1]],k[H]=!0)});w.forEach(B=>{if(!k[B])throw new Error('No provider for "'+B+'". Cannot use provider from the parent!')}),b.unshift(S)}return new tm(b,a)}const v={factory:d,type:p,value:function(b){return b}};function g(b,w){const S=b.__init__||[];return function(){S.forEach(k=>{typeof k=="string"?w.get(k):w.invoke(k)})}}function E(b){const w=b.__exports__;if(w){const S=b.__modules__,k=Object.keys(b).reduce((x,C)=>(C!=="__exports__"&&C!=="__modules__"&&C!=="__init__"&&C!=="__depends__"&&(x[C]=b[C]),x),Object.create(null)),l=f((S||[]).concat(k)),h=os(function(x){return l.get(x)});w.forEach(function(x){r[x]=[h,x,"private",l]});const y=(b.__init__||[]).slice();return y.unshift(function(){l.init()}),g(b=Object.assign({},b,{__init__:y}),l)}return Object.keys(b).forEach(function(S){if(S==="__init__"||S==="__depends__")return;const k=b[S];if(k[2]==="private")return void(r[S]=k);const l=k[0],h=k[1];r[S]=[v[l],A_(l,h),l]}),g(b,a)}function _(b,w){return b.indexOf(w)!==-1||(b=(w.__depends__||[]).reduce(_,b)).indexOf(w)!==-1?b:b.concat(w)}this.get=c,this.invoke=d,this.instantiate=p,this.createChild=f,this.init=function(b){const w=b.reduce(_,[]).map(E);let S=!1;return function(){S||(S=!0,w.forEach(k=>k()))}}(e)}function A_(e,t){return e!=="value"&&Yc(t)&&(t=os(t.slice())),t}function Qn(e,t){var n=this;t=t||1e3,e.on(["render.shape","render.connection"],t,function(i,r){var o=i.type,a=r.element,s=r.gfx,c=r.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(s,a,c):n.drawConnection(s,a,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(i,r){if(n.canRender(r))return i.type==="render.getShapePath"?n.getShapePath(r):n.getConnectionPath(r)})}function sr(e){return e.flat().join(",").replace(/,?([A-z]),?/g,"$1")}function Zc(e){return["L",e.x,e.y]}function T_(e,t){const n=e.length,i=[(r=e[0],["M",r.x,r.y])];var r,o,a,s;for(let c=1;c<n;c++){const u=e[c-1],p=e[c],d=e[c+1];if(!d||!t){i.push(Zc(p));continue}const m=Math.min(t,Qc(p.x-u.x,p.y-u.y),Qc(d.x-p.x,d.y-p.y));if(!m){i.push(Zc(p));continue}const f=as(p,u,m),v=as(p,u,.5*m),g=as(p,d,m),E=as(p,d,.5*m);i.push(Zc(f)),i.push((a=E,s=g,["C",(o=v).x,o.y,a.x,a.y,s.x,s.y]))}return i}function as(e,t,n){const i=t.x-e.x,r=t.y-e.y,o=n/Qc(i,r);return{x:e.x+i*o,y:e.y+r*o}}function Qc(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function ss(e,t,n){ye(t)&&(n=t,t=null),t||(t={});const i=ue("path",t);return ye(n)&&(i.dataset.cornerRadius=String(n)),nm(i,e)}function nm(e,t){return ae(e,{d:sr(T_(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}function ls(e){return Ce(e,function(t){return!Be(e,function(n){return n!==t&&im(t,n)})})}function im(e,t){if(t){if(e===t)return t;if(e.parent)return im(e.parent,t)}}function rm(e,t,n){var i=!n||e.indexOf(t)===-1;return i&&e.push(t),i}function lr(e,t,n){n=n||0,Ee(e)||(e=[e]),$(e,function(i,r){var o=t(i,r,n);Ee(o)&&o.length&&lr(o,t,n+1)})}function Oo(e,t){return function(n,i){var r=[],o=[];return lr(n,function(a,s,c){rm(r,a,i);var u=a.children;if(u&&rm(o,u,i))return u}),r}(e,!t)}function yt(e,t){var n,i,r,o;return t=!!t,Ee(e)||(e=[e]),$(e,function(a){var s=a;a.waypoints&&!t&&(s=yt(a.waypoints,!0));var c=s.x,u=s.y,p=s.height||0,d=s.width||0;(c<n||n===void 0)&&(n=c),(u<i||i===void 0)&&(i=u),(c+d>r||r===void 0)&&(r=c+d),(u+p>o||o===void 0)&&(o=u+p)}),{x:n,y:i,height:o-i,width:r-n}}function om(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function am(e){return!(!e||!e.isFrame)}function Lo(e,t){return z({},e||{},t||{})}function Si(e,t){Qn.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})}Qn.prototype.canRender=function(e){},Qn.prototype.drawShape=function(e,t){},Qn.prototype.drawConnection=function(e,t){},Qn.prototype.getShapePath=function(e){},Qn.prototype.getConnectionPath=function(e){},le(Si,Qn),Si.prototype.canRender=function(){return!0},Si.prototype.drawShape=function(e,t,n){var i=ue("rect");return ae(i,{x:0,y:0,width:t.width||0,height:t.height||0}),am(t)?ae(i,z({},this.FRAME_STYLE,n||{})):ae(i,z({},this.SHAPE_STYLE,n||{})),xe(e,i),i},Si.prototype.drawConnection=function(e,t,n){var i=ss(t.waypoints,z({},this.CONNECTION_STYLE,n||{}));return xe(e,i),i},Si.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return sr([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},Si.prototype.getConnectionPath=function(e){var t,n,i=e.waypoints,r=[];for(t=0;n=i[t];t++)n=n.original||n,r.push([t===0?"M":"L",n.x,n.y]);return sr(r)},Si.$inject=["eventBus","styles"];const P_={__init__:["defaultRenderer"],defaultRenderer:["type",Si],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,i,r){return z(this.style(i,r),{class:n})},this.style=function(n,i){Ee(n)||i||(i=n,n=[]);var r=Ht(n,function(o,a){return z(o,e[a]||{})},{});return i?z(r,i):r},this.computeStyle=function(n,i,r){return Ee(i)||(r=i,i=[]),t.style(i||[],z({},r,n||{}))}}]};function ot(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function ht(e,t,n){if(e&&t){typeof n!="number"&&(n=-1);var i=e.indexOf(t);if(i!==-1){if(i===n||n===-1)return;e.splice(i,1)}n!==-1?e.splice(n,0,t):e.push(t)}}function eu(e,t){return e&&t?e.indexOf(t):-1}function jo(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function tu(e,t,n,i){if(i===void 0&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=jo(e,t);return Math.abs(r/o)<=i}function ei(e,t){var n=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[r,o]of Object.entries(i))if(R_(r,n))return o;return!1}function R_(e,t){const n=t[0];return ar(t,function(i){return Math.abs(n[e]-i[e])<=2})}function sm(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 nu(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var M_=/,?([a-z]),?/gi,lm=parseFloat,at=Math,Ci=at.PI,zn=at.min,Un=at.max,cm=at.pow,ki=at.abs,N_=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,I_=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,cs=Array.isArray||function(e){return e instanceof Array};function iu(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Vo(e){if(typeof e=="function"||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)iu(e,n)&&(t[n]=Vo(e[n]));return t}function Ur(e){var t=Ur.ps=Ur.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout(function(){for(var n in t)iu(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])}),t[e]}function ru(e,t,n,i){return arguments.length===1&&(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 um(){return this.join(",").replace(M_,"$1")}function us(e){var t=Vo(e);return t.toString=um,t}function pm(e,t,n,i,r,o,a,s,c){var u=1-c,p=cm(u,3),d=cm(u,2),m=c*c*c,f=p*t+3*d*c*i+3*u*c*c*o+m*s;return{x:ps(p*e+3*d*c*n+3*u*c*c*r+m*a),y:ps(f)}}function dm(e){var t=function(n,i,r,o,a,s,c,u){for(var p,d,m,f,v,g,E,_,b=[],w=[[],[]],S=0;S<2;++S)if(S==0?(d=6*n-12*r+6*a,p=-3*n+9*r-9*a+3*c,m=3*r-3*n):(d=6*i-12*o+6*s,p=-3*i+9*o-9*s+3*u,m=3*o-3*i),ki(p)<1e-12){if(ki(d)<1e-12)continue;0<(f=-m/d)&&f<1&&b.push(f)}else E=d*d-4*m*p,_=at.sqrt(E),E<0||(0<(v=(-d+_)/(2*p))&&v<1&&b.push(v),0<(g=(-d-_)/(2*p))&&g<1&&b.push(g));for(var k,l=b.length,h=l;l--;)k=1-(f=b[l]),w[0][l]=k*k*k*n+3*k*k*f*r+3*k*f*f*a+f*f*f*c,w[1][l]=k*k*k*i+3*k*k*f*o+3*k*f*f*s+f*f*f*u;return w[0][h]=n,w[1][h]=i,w[0][h+1]=c,w[1][h+1]=u,w[0].length=w[1].length=h+2,{x0:zn(...w[0]),y0:zn(...w[1]),x1:Un(...w[0]),y1:Un(...w[1])}}(...e);return ru(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function Ai(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function hm(e,t,n,i,r){return e*(e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i)-3*t+3*n}function mm(e,t,n,i,r,o,a,s,c){c==null&&(c=1);for(var u=(c=c>1?1:c<0?0:c)/2,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],m=0,f=0;f<12;f++){var v=u*p[f]+u,g=hm(v,e,n,r,a),E=hm(v,t,i,o,s),_=g*g+E*E;m+=d[f]*at.sqrt(_)}return u*m}function B_(e,t,n,i,r,o,a,s){if(!(Un(e,n)<zn(r,a)||zn(e,n)>Un(r,a)||Un(t,i)<zn(o,s)||zn(t,i)>Un(o,s))){var c=(e*i-t*n)*(o-s)-(t-i)*(r*s-o*a),u=(e-n)*(o-s)-(t-i)*(r-a);if(u){var p=ps(((e*i-t*n)*(r-a)-(e-n)*(r*s-o*a))/u),d=ps(c/u),m=+p.toFixed(2),f=+d.toFixed(2);if(!(m<+zn(e,n).toFixed(2)||m>+Un(e,n).toFixed(2)||m<+zn(r,a).toFixed(2)||m>+Un(r,a).toFixed(2)||f<+zn(t,i).toFixed(2)||f>+Un(t,i).toFixed(2)||f<+zn(o,s).toFixed(2)||f>+Un(o,s).toFixed(2)))return{x:p,y:d}}}}function ps(e){return Math.round(1e11*e)/1e11}function D_(e,t,n){if(i=dm(e),r=dm(t),i=ru(i),!(Ai(r=ru(r),i.x,i.y)||Ai(r,i.x2,i.y)||Ai(r,i.x,i.y2)||Ai(r,i.x2,i.y2)||Ai(i,r.x,r.y)||Ai(i,r.x2,r.y)||Ai(i,r.x,r.y2)||Ai(i,r.x2,r.y2)||(i.x<r.x2&&i.x>r.x||r.x<i.x2&&r.x>i.x)&&(i.y<r.y2&&i.y>r.y||r.y<i.y2&&r.y>i.y)))return n?0:[];for(var i,r,o=mm(...e),a=mm(...t),s=vm(e)?1:~~(o/5)||1,c=vm(t)?1:~~(a/5)||1,u=[],p=[],d={},m=n?0:[],f=0;f<s+1;f++){var v=pm(...e,f/s);u.push({x:v.x,y:v.y,t:f/s})}for(f=0;f<c+1;f++)v=pm(...t,f/c),p.push({x:v.x,y:v.y,t:f/c});for(f=0;f<s;f++)for(var g=0;g<c;g++){var E,_=u[f],b=u[f+1],w=p[g],S=p[g+1],k=ki(b.x-_.x)<.01?"y":"x",l=ki(S.x-w.x)<.01?"y":"x",h=B_(_.x,_.y,b.x,b.y,w.x,w.y,S.x,S.y);if(h){if(d[E=h.x.toFixed(9)+"#"+h.y.toFixed(9)])continue;d[E]=!0;var y=_.t+ki((h[k]-_[k])/(b[k]-_[k]))*(b.t-_.t),x=w.t+ki((h[l]-w[l])/(S[l]-w[l]))*(S.t-w.t);y>=0&&y<=1&&x>=0&&x<=1&&(n?m++:m.push({x:h.x,y:h.y,t1:y,t2:x}))}}return m}function fm(e,t,n){e=bm(e),t=bm(t);for(var i,r,o,a,s,c,u,p,d,m,f=n?0:[],v=0,g=e.length;v<g;v++){var E=e[v];if(E[0]=="M")i=s=E[1],r=c=E[2];else{E[0]=="C"?(i=(d=[i,r,...E.slice(1)])[6],r=d[7]):(d=[i,r,i,r,s,c,s,c],i=s,r=c);for(var _=0,b=t.length;_<b;_++){var w=t[_];if(w[0]=="M")o=u=w[1],a=p=w[2];else{w[0]=="C"?(o=(m=[o,a,...w.slice(1)])[6],a=m[7]):(m=[o,a,o,a,u,p,u,p],o=u,a=p);var S=D_(d,m,n);if(n)f+=S;else{for(var k=0,l=S.length;k<l;k++)S[k].segment1=v,S[k].segment2=_,S[k].bez1=d,S[k].bez2=m;f=f.concat(S)}}}}}return f}function O_(e){var t=Ur(e);if(t.abs)return us(t.abs);if(cs(e)&&cs(e&&e[0])||(e=function(_){if(!_)return null;var b=Ur(_);if(b.arr)return Vo(b.arr);var w={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},S=[];return cs(_)&&cs(_[0])&&(S=Vo(_)),S.length||String(_).replace(N_,function(k,l,h){var y=[],x=l.toLowerCase();for(h.replace(I_,function(C,N){N&&y.push(+N)}),x=="m"&&y.length>2&&(S.push([l,...y.splice(0,2)]),x="l",l=l=="m"?"l":"L");y.length>=w[x]&&(S.push([l,...y.splice(0,w[x])]),w[x]););}),S.toString=Ur.toString,b.arr=Vo(S),S}(e)),!e||!e.length)return[["M",0,0]];var n,i=[],r=0,o=0,a=0,s=0,c=0;e[0][0]=="M"&&(a=r=+e[0][1],s=o=+e[0][2],c++,i[0]=["M",r,o]);for(var u,p,d=c,m=e.length;d<m;d++){if(i.push(u=[]),(n=(p=e[d])[0])!=n.toUpperCase())switch(u[0]=n.toUpperCase(),u[0]){case"A":u[1]=p[1],u[2]=p[2],u[3]=p[3],u[4]=p[4],u[5]=p[5],u[6]=+p[6]+r,u[7]=+p[7]+o;break;case"V":u[1]=+p[1]+o;break;case"H":u[1]=+p[1]+r;break;case"M":a=+p[1]+r,s=+p[2]+o;default:for(var f=1,v=p.length;f<v;f++)u[f]=+p[f]+(f%2?r:o)}else for(var g=0,E=p.length;g<E;g++)u[g]=p[g];switch(n=n.toUpperCase(),u[0]){case"Z":r=+a,o=+s;break;case"H":r=u[1];break;case"V":o=u[1];break;case"M":a=u[u.length-2],s=u[u.length-1];default:r=u[u.length-2],o=u[u.length-1]}}return i.toString=um,t.abs=us(i),i}function vm(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function ds(e,t,n,i){return[e,t,n,i,n,i]}function ym(e,t,n,i,r,o){var a=.3333333333333333,s=2/3;return[a*e+s*n,a*t+s*i,a*r+s*n,a*o+s*i,r,o]}function gm(e,t,n,i,r,o,a,s,c,u){var p,d=120*Ci/180,m=Ci/180*(+r||0),f=[],v=function j(){var G=Array.prototype.slice.call(arguments,0).join("\u2400"),J=j.cache=j.cache||{},Y=j.count=j.count||[];return iu(J,G)?(function(he,be){for(var je=0,De=he.length;je<De;je++)if(he[je]===be)return he.push(he.splice(je,1)[0])}(Y,G),J[G]):(Y.length>=1e3&&delete J[Y.shift()],Y.push(G),J[G]=function(he,be,je){return{x:he*at.cos(je)-be*at.sin(je),y:he*at.sin(je)+be*at.cos(je)}}(...arguments),J[G])};if(u)h=u[0],y=u[1],k=u[2],l=u[3];else{e=(p=v(e,t,-m)).x,t=p.y;var g=(e-(s=(p=v(s,c,-m)).x))/2,E=(t-(c=p.y))/2,_=g*g/(n*n)+E*E/(i*i);_>1&&(n*=_=at.sqrt(_),i*=_);var b=n*n,w=i*i,S=(o==a?-1:1)*at.sqrt(ki((b*w-b*E*E-w*g*g)/(b*E*E+w*g*g))),k=S*n*E/i+(e+s)/2,l=S*-i*g/n+(t+c)/2,h=at.asin(((t-l)/i).toFixed(9)),y=at.asin(((c-l)/i).toFixed(9));(h=e<k?Ci-h:h)<0&&(h=2*Ci+h),(y=s<k?Ci-y:y)<0&&(y=2*Ci+y),a&&h>y&&(h-=2*Ci),!a&&y>h&&(y-=2*Ci)}var x=y-h;if(ki(x)>d){var C=y,N=s,O=c;y=h+d*(a&&y>h?1:-1),f=gm(s=k+n*at.cos(y),c=l+i*at.sin(y),n,i,r,0,a,N,O,[y,C,k,l])}x=y-h;var B=at.cos(h),H=at.sin(h),q=at.cos(y),U=at.sin(y),V=at.tan(x/4),te=4/3*n*V,X=4/3*i*V,oe=[e,t],ne=[e+te*H,t-X*B],I=[s+te*U,c-X*q],R=[s,c];if(ne[0]=2*oe[0]-ne[0],ne[1]=2*oe[1]-ne[1],u)return[ne,I,R].concat(f);for(var M=[],L=0,K=(f=[ne,I,R].concat(f).join().split(",")).length;L<K;L++)M[L]=L%2?v(f[L-1],f[L],m).y:v(f[L],f[L+1],m).x;return M}function bm(e){var t=Ur(e);if(t.curve)return us(t.curve);for(var n=O_(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(f,v,g){var E,_;if(!f)return["C",v.x,v.y,v.x,v.y,v.x,v.y];switch(!(f[0]in{T:1,Q:1})&&(v.qx=v.qy=null),f[0]){case"M":v.X=f[1],v.Y=f[2];break;case"A":f=["C",...gm(v.x,v.y,...f.slice(1))];break;case"S":g=="C"||g=="S"?(E=2*v.x-v.bx,_=2*v.y-v.by):(E=v.x,_=v.y),f=["C",E,_,...f.slice(1)];break;case"T":g=="Q"||g=="T"?(v.qx=2*v.x-v.qx,v.qy=2*v.y-v.qy):(v.qx=v.x,v.qy=v.y),f=["C",...ym(v.x,v.y,v.qx,v.qy,f[1],f[2])];break;case"Q":v.qx=f[1],v.qy=f[2],f=["C",...ym(v.x,v.y,f[1],f[2],f[3],f[4])];break;case"L":f=["C",...ds(v.x,v.y,f[1],f[2])];break;case"H":f=["C",...ds(v.x,v.y,f[1],v.y)];break;case"V":f=["C",...ds(v.x,v.y,v.x,f[1])];break;case"Z":f=["C",...ds(v.x,v.y,v.X,v.Y)]}return f},o=function(f,v){if(f[v].length>7){f[v].shift();for(var g=f[v];g.length;)a[v]="A",f.splice(v++,0,["C",...g.splice(0,6)]);f.splice(v,1),p=n.length}},a=[],s="",c="",u=0,p=n.length;u<p;u++){n[u]&&(s=n[u][0]),s!="C"&&(a[u]=s,u&&(c=a[u-1])),n[u]=r(n[u],i,c),a[u]!="A"&&s=="C"&&(a[u]="C"),o(n,u);var d=n[u],m=d.length;i.x=d[m-2],i.y=d[m-1],i.bx=lm(d[m-4])||i.x,i.by=lm(d[m-3])||i.y}return t.curve=us(n),n}function Fe(e){return vt(e)&&Lt(e,"waypoints")}function Re(e){return vt(e)&&Lt(e,"labelTarget")}function xm(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function Ti(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function de(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function hs(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function ge(e){return Fe(e)?function(n){for(var i=n.waypoints,r=i.reduce(function(u,p,d){var m=i[d-1];if(m){var f=u[u.length-1],v=f&&f.endLength||0,g=function(E,_){return Math.sqrt(Math.pow(E.x-_.x,2)+Math.pow(E.y-_.y,2))}(m,p);u.push({start:m,end:p,startLength:v,endLength:v+g,length:g})}return u},[]),o=r.reduce(function(u,p){return u+p.length},0)/2,a=0,s=r[a];s.endLength<o;)s=r[++a];var c=(o-s.startLength)/s.length;return{x:s.start.x+(s.end.x-s.start.x)*c,y:s.start.y+(s.end.y-s.start.y)*c}}(e):Ti({x:(t=e).x+(t.width||0)/2,y:t.y+(t.height||0)/2});var t}function Tt(e,t,n){vt(n=n||0)||(n={x:n,y:n});var i=de(e),r=de(t),o=i.bottom+n.y<=r.top,a=i.left-n.x>=r.right,s=i.top-n.y>=r.bottom,c=o?"top":s?"bottom":null,u=i.right+n.x<=r.left?"left":a?"right":null;return u&&c?c+"-"+u:u||c||"intersect"}function ou(e,t,n){var i=function(r,o){return fm(r,o)}(e,t);return i.length===1||i.length===2&&jo(i[0],i[1])<1?Ti(i[0]):i.length>1?(i=$n(i,function(r){var o=Math.floor(100*r.t2)||1;return o=((o=100-o)<10?"0":"")+o,r.segment2+"#"+o}),Ti(i[n?0:i.length-1])):null}function ms(e,t){return Math.round(e*t)/t}function _m(e){return ye(e)?e+"px":e}function Em(e,t,n){const i=ue("g");Pe(i).add(t);const r=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const L_={shape:["x","y","width","height"],connection:["waypoints"]};function we(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._init(e||{})}function wm(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}we.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],we.prototype._init=function(e){const t=this._eventBus,n=this._container=function(o){const a=(o=z({},{width:"100%",height:"100%"},o)).container||document.body,s=document.createElement("div");return s.setAttribute("class","djs-container djs-parent"),At(s,{position:"relative",overflow:"hidden",width:_m(o.width),height:_m(o.height)}),a.appendChild(s),s}(e),i=this._svg=ue("svg");ae(i,{width:"100%",height:"100%"}),xe(n,i);const r=this._viewport=Em(i,"viewport");e.deferUpdate&&(this._viewboxChanged=$h(jt(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:i,viewport:r})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},we.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},we.prototype._clear=function(){this._elementRegistry.getAll().forEach(e=>{const t=om(e);t==="root"?this.removeRootElement(e):this._removeElement(e,t)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},we.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},we.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),t!==void 0&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},we.prototype._getChildIndex=function(e){return Ht(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)},we.prototype._createLayer=function(e,t){t===void 0&&(t=1);const n=this._getChildIndex(t);return{group:Em(this._viewport,"layer-"+e,n),index:t,visible:!0}},we.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,i=t.group,r=t.index;if(t.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},we.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=t.group;return t.visible&&(dt(n),t.visible=!1),n},we.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],dt(t.group))},we.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},we.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(function(n){for(;n.parent;)n=n.parent;return n}(e))||{}).rootElement:void 0},we.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},we.prototype._findPlaneForRoot=function(e){return Be(this._planes,function(t){return t.rootElement===e})},we.prototype.getContainer=function(){return this._container},we.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,i=this._elementRegistry._elements[e.id],i&&($([i.gfx,i.secondaryGfx],function(r){r&&(n?(e.markers.add(t),Pe(r).add(t)):(e.markers.delete(t),Pe(r).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},we.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},we.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},we.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),!!e.markers&&e.markers.has(t)},we.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},we.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},we.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(n,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},we.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(t){return t.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e},we.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},we.prototype._removeRoot=function(e){const t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},we.prototype._addRoot=function(e,t){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},we.prototype._setRoot=function(e,t){const n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},we.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");const n=L_[e];if(!ar(n,function(r){return t[r]!==void 0}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},we.prototype._setParent=function(e,t,n){ht(t.children,e,n),e.parent=t},we.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);const a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},we.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},we.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},we.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),ot(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},we.prototype.removeShape=function(e){return this._removeElement(e,"shape")},we.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},we.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},we.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},we.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},we.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);const t=this._viewport,n=this.getSize();let i,r,o,a,s,c,u;return e?(this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);const p=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Do(t,p)}),e):(o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},a=Do(t),r=a?a.matrix:function(p,d,m,f,v,g){var E=Yh().createSVGMatrix();switch(arguments.length){case 0:return E;case 1:return Jh(E,p);case 6:return Jh(E,{a:p,b:d,c:m,d:f,e:v,f:g})}}(),s=ms(r.a,1e3),c=ms(-r.e||0,1e3),u=ms(-r.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:u?u/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n})},we.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox(function(){e=z({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),wm(t,n)}),{x:n.e,y:n.f}},we.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);if(i!==this.getRootElement()&&this.setRootElement(i),i===e)return;t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const r=yt(e),o=de(r),a=this.viewbox(),s=this.zoom();let c,u;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;const p=de(a);if(r.width<a.width&&r.height<a.height){const d=Math.max(0,o.right-p.right),m=Math.min(0,o.left-p.left),f=Math.max(0,o.bottom-p.bottom),v=Math.min(0,o.top-p.top);c=d||m,u=f||v}else c=r.x-a.x,u=r.y-a.y;this.scroll({dx:-c*s,dy:-u*s})},we.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if(e==="fit-viewport")return this._fitViewport(t);let n,i;return this._changeViewbox(function(){typeof t!="object"&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)}),ms(i.a,1e3)},we.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,i=t.inner;let r,o;return i.x>=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},we.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,c,u,p;c=i.getCTM();const d=c.a;return t?(a=z(o,t),s=a.matrixTransform(c.inverse()),u=r.translate(s.x,s.y).scale(1/d*e).translate(-s.x,-s.y),p=c.multiply(u)):p=r.scale(e),wm(this._viewport,p),p},we.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},we.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;return n=e.waypoints?this.getGraphics(e).getBBox():e,{x:n.x*t.scale-t.x*t.scale,y:n.y*t.scale-t.y*t.scale,width:n.width*t.scale,height:n.height*t.scale}},we.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Hr="data-element-id";function Zt(e){this._elements={},this._eventBus=e}function Sm(e,t,n){var i=function(r,o,a,s){var c=a.inverse;return Object.defineProperty(r,"remove",{value:function(u){var p=this.indexOf(u);return p!==-1&&(this.splice(p,1),o.unset(u,c,s)),u}}),Object.defineProperty(r,"contains",{value:function(u){return this.indexOf(u)!==-1}}),Object.defineProperty(r,"add",{value:function(u,p){var d=this.indexOf(u);if(p===void 0){if(d!==-1)return;p=this.length}d!==-1&&this.splice(d,1),this.splice(p,0,u),d===-1&&o.set(u,c,s)}}),Object.defineProperty(r,"__refs_collection",{value:!0}),r}(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach(function(r){e.set(r,t.inverse,n)})}function pn(e,t){if(!(this instanceof pn))return new pn(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Zt.$inject=["eventBus"],Zt.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),ae(t,Hr,i),n&&ae(n,Hr,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Zt.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(ae(i.gfx,Hr,""),i.secondaryGfx&&ae(i.secondaryGfx,Hr,""),delete t[n])},Zt.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(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)},Zt.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&ae(t,Hr,i),t},Zt.prototype.get=function(e){var t;t=typeof e=="string"?e:e&&ae(e,Hr);var n=this._elements[t];return n&&n.element},Zt.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},Zt.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}},Zt.prototype.getAll=function(){return this.filter(function(e){return e})},Zt.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)})},Zt.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},Zt.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")},pn.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Sm(this,t,e):function(n,i,r){var o=i.inverse,a=r[i.name];Object.defineProperty(r,i.name,{configurable:i.configurable,enumerable:i.enumerable,get:function(){return a},set:function(s){if(s!==a){var c=a;a=null,c&&n.unset(c,o,r),a=s,n.set(a,o,r)}}})}(this,t,e)},pn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return function(i){return i.__refs_collection===!0}(n)||Sm(this,t,e),n},pn.prototype.ensureBound=function(e,t){(function(n,i){return Object.prototype.hasOwnProperty.call(n,i.name||i)})(e,t)||this.bind(e,t)},pn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},pn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var au=new pn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Cm=new pn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),km=new pn({name:"attachers",collection:!0},{name:"host"}),Am=new pn({name:"outgoing",collection:!0},{name:"source"}),Tm=new pn({name:"incoming",collection:!0},{name:"target"});function Gr(){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)}}),au.bind(this,"parent"),Cm.bind(this,"labels"),Am.bind(this,"outgoing"),Tm.bind(this,"incoming")}function $o(){Gr.call(this),au.bind(this,"children"),km.bind(this,"host"),km.bind(this,"attachers")}function Pm(){Gr.call(this),au.bind(this,"children")}function Rm(){$o.call(this),Cm.bind(this,"labelTarget")}function Mm(){Gr.call(this),Am.bind(this,"source"),Tm.bind(this,"target")}le($o,Gr),le(Pm,$o),le(Rm,$o),le(Mm,Gr);var j_={connection:Mm,shape:$o,label:Rm,root:Pm};function ti(){this._uid=12}ti.prototype.createRoot=function(e){return this.create("root",e)},ti.prototype.createLabel=function(e){return this.create("label",e)},ti.prototype.createShape=function(e){return this.create("shape",e)},ti.prototype.createConnection=function(e){return this.create("connection",e)},ti.prototype.create=function(e,t){return(t=z({},t||{})).id||(t.id=e+"_"+this._uid++),function(n,i){var r=j_[n];if(!r)throw new Error("unknown type: <"+n+">");return z(new r,i)}(e,t)};var fs="__fn",V_=Array.prototype.slice;function Wt(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Fo(){}function cr(e){return e.childNodes[0]}function vs(e,t,n,i,r){var o=Bo();o.setTranslate(t,n);var a=Bo();a.setRotate(i||0,0,0);var s=Bo();s.setScale(1,1),Do(e,[o,a,s])}function Et(e,t,n){var i=Bo();i.setTranslate(t,n),Do(e,i)}function Nm(e,t){var n=Bo();n.setRotate(t,0,0),Do(e,n)}function Qt(e,t){this._eventBus=e,this._elementRegistry=t}function Im(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}Wt.prototype.on=function(e,t,n,i){if(e=Ee(e)?e:[e],rt(t)&&(i=n,n=t,t=1e3),!ye(t))throw new Error("priority must be a number");var r=n;i&&((r=jt(n,i))[fs]=n[fs]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:r,next:null})})},Wt.prototype.once=function(e,t,n,i){var r=this;if(rt(t)&&(i=n,n=t,t=1e3),!ye(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(i,arguments);return r.off(e,o),a}o[fs]=n,this.on(e,t,o)},Wt.prototype.off=function(e,t){e=Ee(e)?e:[e];var n=this;e.forEach(function(i){n._removeListener(i,t)})},Wt.prototype.createEvent=function(e){var t=new Fo;return t.init(e),t},Wt.prototype.fire=function(e,t){var n,i,r,o;if(o=V_.call(arguments),typeof e=="object"&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof Fo?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return r===void 0&&n.defaultPrevented&&(r=!1),r}},Wt.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},Wt.prototype._destroy=function(){this._listeners={}},Wt.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},Wt.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(r,o){return r.apply(null,o)}(n.callback,t),i!==void 0&&(e.returnValue=i,e.stopPropagation()),i===!1&&e.preventDefault()}catch(r){if(!this.handleError(r))throw console.error("unhandled error in event listener",r),r}return i},Wt.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},Wt.prototype._getListeners=function(e){return this._listeners[e]},Wt.prototype._setListeners=function(e,t){this._listeners[e]=t},Wt.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r[fs]!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},Fo.prototype.stopPropagation=function(){this.cancelBubble=!0},Fo.prototype.preventDefault=function(){this.defaultPrevented=!0},Fo.prototype.init=function(e){z(this,e||{})},Qt.$inject=["eventBus","elementRegistry"],Qt.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(i){return i.parentNode.childNodes[1]}(n),t||(Pe(t=ue("g")).add("djs-children"),xe(n.parentNode,t))):t=n,t},Qt.prototype._clear=function(e){var t=cr(e);return es(t),t},Qt.prototype._createContainer=function(e,t,n,i){var r=ue("g");Pe(r).add("djs-group"),n!==void 0?Im(r,t,t.childNodes[n]):xe(t,r);var o=ue("g");Pe(o).add("djs-element"),Pe(o).add("djs-"+e),i&&Pe(o).add("djs-frame"),xe(r,o);var a=ue("g");return Pe(a).add("djs-visual"),xe(o,a),o},Qt.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,am(t))},Qt.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=Ht(e,function(r,o){return o.parent&&(r[o.parent.id]=o.parent),r},{}),$(t,function(r){var o=r.children;if(o){var a=n._getChildrenContainer(r);$(o.slice().reverse(),function(s){Im(i.getGraphics(s).parentNode,a)})}})},Qt.prototype.drawShape=function(e,t,n={}){return this._eventBus.fire("render.shape",{gfx:e,element:t,attrs:n})},Qt.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Qt.prototype.drawConnection=function(e,t,n={}){return this._eventBus.fire("render.connection",{gfx:e,element:t,attrs:n})},Qt.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Qt.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if(e==="shape")this.drawShape(i,t),Et(n,t.x,t.y);else{if(e!=="connection")throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?ae(n,"display","none"):ae(n,"display","block")}},Qt.prototype.remove=function(e){dt(this._elementRegistry.getGraphics(e).parentNode)};const $_={__depends__:[P_],__init__:["canvas"],canvas:["type",we],elementRegistry:["type",Zt],elementFactory:["type",ti],eventBus:["type",Wt],graphicsFactory:["type",Qt]};function Pi(e,t){this._injector=t||function(n){return i=[{config:["value",n=n||{}]},$_].concat(n.modules||[]),(r=new tm(i)).init(),r;var i,r}(e),this.get("eventBus").fire("diagram.init")}function su(){}function Bm(e,t){this.model=e,this.properties=t}Pi.prototype.get=function(e,t){return this._injector.get(e,t)},Pi.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},Pi.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Pi.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},su.prototype.get=function(e){return this.$model.properties.get(this,e)},su.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},Bm.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(su.prototype);$(e.properties,function(a){a.isMany||a.default===void 0||(i[a.name]=a.default)}),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(a){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),$(a,jt(function(s,c){this.set(c,s)},this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var F_={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Dm={String:function(e){return e},Boolean:function(e){return e==="true"},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function lu(e,t){var n=Dm[e];return n?n(t):t}function cu(e){return!!F_[e]}function Om(e){return!!Dm[e]}function Bt(e,t){var n,i,r=e.split(/:/);if(r.length===1)n=e,i=t;else{if(r.length!==2)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function en(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function Ri(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,$(e,jt(this.registerPackage,this))}function Lm(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function ur(e){this.model=e}function jm(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function uu(e){return e.replace(/^:/,"")}function dn(e,t={}){this.properties=new ur(this),this.factory=new Bm(this,this.properties),this.registry=new Ri(e,this.properties),this.typeCache={},this.config=t}en.prototype.build=function(){return Pn(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},en.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var i=this.properties;t!==void 0?i.splice(t,0,e):i.push(e)},en.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=r.indexOf(e);if(s===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),o[i.name]=o[i.localName]=t},en.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=Bt(r[0],i),a=Bt(r[1],o.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},en.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},en.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},en.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},en.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},en.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},en.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},en.prototype.hasProperty=function(e){return this.propertiesByName[e]},en.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||($(e.properties,jt(function(o){o=z({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,s=o.redefines;a||s?this.redefineProperty(o,a||s,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),i.push(e),n[r]=e)},Ri.prototype.getPackage=function(e){return this.packageMap[e]},Ri.prototype.getPackages=function(){return this.packages},Ri.prototype.registerPackage=function(e){e=z({},e);var t=this.packageMap;Lm(t,e,"prefix"),Lm(t,e,"uri"),$(e.types,jt(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Ri.prototype.registerType=function(e,t){var n=Bt((e=z({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:z(e.meta||{})})).name,t.prefix),i=n.name,r={};$(e.properties,jt(function(o){var a=Bt(o.name,n.prefix),s=a.name;cu(o.type)||(o.type=Bt(o.type,a.prefix).name),z(o,{ns:a,name:s}),r[s]=o},this)),z(e,{ns:n,name:i,propertiesByName:r}),$(e.extends,jt(function(o){var a=Bt(o,n.prefix),s=this.typeMap[a.name];s.traits=s.traits||[],s.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},Ri.prototype.mapTypes=function(e,t,n){var i=cu(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(s,c){var u=Bt(s,cu(s)?"":e.prefix);r.mapTypes(u,t,c)}function a(s){return o(s,!0)}if(!i)throw new Error("unknown type <"+e.name+">");$(i.superClass,n?a:function(s){return o(s,!1)}),t(i,!n),$(i.traits,a)},Ri.prototype.getEffectiveDescriptor=function(e){var t=Bt(e),n=new en(t);this.mapTypes(t,function(r,o){n.addTrait(r,o)});var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},Ri.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},ur.prototype.set=function(e,t,n){if(!Ut(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(e,t),r=i&&i.name;n===void 0?i?delete e[r]:delete e.$attrs[uu(t)]:i?r in e?e[r]=n:jm(e,i,n):e.$attrs[uu(t)]=n},ur.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[uu(t)];var i=n.name;return!e[i]&&n.isMany&&jm(e,n,[]),e[i]},ur.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=z({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},ur.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},ur.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},ur.prototype.getProperty=function(e,t){var n=this.model,i=n.getPropertyDescriptor(e,t);if(i)return i;if(t.includes(":"))return null;const r=n.config.strict;if(r!==void 0){const o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw o;typeof console<"u"&&console.warn(o)}return null},dn.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},dn.prototype.getType=function(e){var t=this.typeCache,n=Ut(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},dn.prototype.createAny=function(e,t,n){var i=Bt(e),r={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){(function(c,u,p){let d=c;$(u,function(m,f){if(typeof m!="number"&&typeof m!="string")throw new Error("illegal key type: "+typeof m+". Key should be of type number or string.");if(m==="constructor")throw new Error("illegal key: constructor");if(m==="__proto__")throw new Error("illegal key: __proto__");let v=u[f+1],g=d[m];xt(v)&&Io(g)&&(g=d[m]=isNaN(+v)?{}:[]),or(v)?or(p)?delete d[m]:d[m]=p:d=g})})(this,[a],s)}},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}),$(n,function(a,s){vt(a)&&a.value!==void 0?r[a.name]=a.value:r[s]=a}),r},dn.prototype.getPackage=function(e){return this.registry.getPackage(e)},dn.prototype.getPackages=function(){return this.registry.getPackages()},dn.prototype.getElementDescriptor=function(e){return e.$descriptor},dn.prototype.hasType=function(e,t){return t===void 0&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},dn.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},dn.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var z_=String.fromCharCode,U_=Object.prototype.hasOwnProperty,H_=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,zo={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function G_(e,t,n,i){return i?U_.call(zo,i)?zo[i]:"&"+i+";":z_(t||parseInt(n,16))}function pr(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(H_,G_):e}Object.keys(zo).forEach(function(e){zo[e.toUpperCase()]=zo[e]});var Vm="xsi:type",$m="non-whitespace outside of root node";function Wr(e){return new Error(e)}function Fm(e){return"missing namespace for prefix <"+e+">"}function ys(e){return{get:e,enumerable:!0}}function W_(e){var t,n={};for(t in e)n[t]=e[t];return n}function pu(e){return e+"$uri"}function zm(){return{line:0,column:0}}function q_(e){throw e}function Um(e){if(!this)return new Um(e);var t,n,i,r,o,a,s,c,u,p=e&&e.proxy,d=q_,m=zm,f=!1,v=!1,g=null,E=!1;function _(w){w instanceof Error||(w=Wr(w)),g=w,d(w,m)}function b(w){o&&(w instanceof Error||(w=Wr(w)),o(w,m))}this.on=function(w,S){if(typeof S!="function")throw Wr("required args <name, cb>");switch(w){case"openTag":n=S;break;case"text":t=S;break;case"closeTag":i=S;break;case"error":d=S;break;case"warn":o=S;break;case"cdata":r=S;break;case"attention":c=S;break;case"question":s=S;break;case"comment":a=S;break;default:throw Wr("unsupported event: "+w)}return this},this.ns=function(w){if(w===void 0&&(w={}),typeof w!="object")throw Wr("required args <nsMap={}>");var S,k={};for(S in w)k[S]=w[S];return k["http://www.w3.org/2001/XMLSchema-instance"]="xsi",v=!0,u=k,this},this.parse=function(w){if(typeof w!="string")throw Wr("required args <xml=string>");return g=null,function(S){var k,l,h,y,x,C,N,O,B,H,q,U=v?[]:null,V=v?function(j){var G,J,Y={};for(G in j)Y[J=j[G]]=J,Y[pu(J)]=G;return Y}(u):null,te=[],X=0,oe=!1,ne=!1,I=0,R=0,M="",L=0;function K(){if(q!==null)return q;var j,G,J,Y,he,be,je,De,Mt,ie,Ie,Sn=v&&V.xmlns,yi=v&&f?[]:null,nt=L,Ot=M,Ln=Ot.length,jn={},jr={};e:for(;nt<Ln;nt++)if(Mt=!1,!((ie=Ot.charCodeAt(nt))===32||ie<14&&ie>8)){for((ie<65||ie>122||ie>90&&ie<97)&&ie!==95&&ie!==58&&(b("illegal first char attribute name"),Mt=!0),Ie=nt+1;Ie<Ln;Ie++)if(!((ie=Ot.charCodeAt(Ie))>96&&ie<123||ie>64&&ie<91||ie>47&&ie<59||ie===46||ie===45||ie===95)){if(ie===32||ie<14&&ie>8){b("missing attribute value"),nt=Ie;continue e}if(ie===61)break;b("illegal attribute name char"),Mt=!0}if((De=Ot.substring(nt,Ie))==="xmlns:xmlns"&&(b("illegal declaration of xmlns"),Mt=!0),(ie=Ot.charCodeAt(Ie+1))===34)(Ie=Ot.indexOf('"',nt=Ie+2))===-1&&(Ie=Ot.indexOf("'",nt))!==-1&&(b("attribute value quote missmatch"),Mt=!0);else if(ie===39)(Ie=Ot.indexOf("'",nt=Ie+2))===-1&&(Ie=Ot.indexOf('"',nt))!==-1&&(b("attribute value quote missmatch"),Mt=!0);else for(b("missing attribute value quotes"),Mt=!0,Ie+=1;Ie<Ln&&!((ie=Ot.charCodeAt(Ie+1))===32||ie<14&&ie>8);Ie++);for(Ie===-1&&(b("missing closing quotes"),Ie=Ln,Mt=!0),Mt||(be=Ot.substring(nt,Ie)),nt=Ie;Ie+1<Ln&&!((ie=Ot.charCodeAt(Ie+1))===32||ie<14&&ie>8);Ie++)nt===Ie&&(b("illegal character after attribute end"),Mt=!0);if(nt=Ie+1,!Mt)if(De in jr)b("attribute <"+De+"> already defined");else if(jr[De]=!0,v)if(f){if((he=De==="xmlns"?"xmlns":De.charCodeAt(0)===120&&De.substr(0,6)==="xmlns:"?De.substr(6):null)!==null){if(j=pr(be),G=pu(he),!(je=u[j])){if(he==="xmlns"||G in V&&V[G]!==j)do je="ns"+X++;while(V[je]!==void 0);else je=he;u[j]=je}V[he]!==je&&(Y||(V=W_(V),Y=!0),V[he]=je,he==="xmlns"&&(V[pu(je)]=j,Sn=je),V[G]=j),jn[De]=be;continue}yi.push(De,be)}else(ie=De.indexOf(":"))!==-1?(J=V[De.substring(0,ie)])?((De=Sn===J?De.substr(ie+1):J+De.substr(ie))===Vm&&((ie=be.indexOf(":"))!==-1?(J=be.substring(0,ie),be=(J=V[J]||J)+be.substring(ie)):be=Sn+":"+be),jn[De]=be):b(Fm(De.substring(0,ie))):jn[De]=be;else jn[De]=be}if(f)for(nt=0,Ln=yi.length;nt<Ln;nt++){if(De=yi[nt++],be=yi[nt],(ie=De.indexOf(":"))!==-1){if(!(J=V[De.substring(0,ie)])){b(Fm(De.substring(0,ie)));continue}(De=Sn===J?De.substr(ie+1):J+De.substr(ie))===Vm&&((ie=be.indexOf(":"))!==-1?(J=be.substring(0,ie),be=(J=V[J]||J)+be.substring(ie)):be=Sn+":"+be)}jn[De]=be}return q=jn}for(m=function(){for(var j,G,J=/(\r\n|\r|\n)/g,Y=0,he=0,be=0,je=R;I>=be&&(j=J.exec(S))&&!((je=j[0].length+j.index)>I);)Y+=1,be=je;return I==-1?(he=je,G=S.substring(R)):R===0?G=S.substring(R,I):(he=I-be,G=R==-1?S.substring(I):S.substring(I,R+1)),{data:G,line:Y,column:he}},p&&(H=Object.create({},{name:ys(function(){return O}),originalName:ys(function(){return B}),attrs:ys(K),ns:ys(function(){return V})}));R!==-1;){if((I=S.charCodeAt(R)===60?R:S.indexOf("<",R))===-1)return te.length?_("unexpected end of file"):R===0?_("missing start tag"):void(R<S.length&&S.substring(R).trim()&&b($m));if(R!==I){if(te.length){if(t&&(t(S.substring(R,I),pr,m),E))return}else if(S.substring(R,I).trim()&&(b($m),E))return}if((x=S.charCodeAt(I+1))===33){if((y=S.charCodeAt(I+2))===91&&S.substr(I+3,6)==="CDATA["){if((R=S.indexOf("]]>",I))===-1)return _("unclosed cdata");if(r&&(r(S.substring(I+9,R),m),E))return;R+=3;continue}if(y===45&&S.charCodeAt(I+3)===45){if((R=S.indexOf("-->",I))===-1)return _("unclosed comment");if(a&&(a(S.substring(I+4,R),pr,m),E))return;R+=3;continue}}if(x!==63){for(l=I+1;;l++){if(C=S.charCodeAt(l),isNaN(C))return R=-1,_("unclosed tag");if(C===34)l=(y=S.indexOf('"',l+1))!==-1?y:l;else if(C===39)l=(y=S.indexOf("'",l+1))!==-1?y:l;else if(C===62){R=l;break}}if(x!==33){if(q={},x===47){if(oe=!1,ne=!0,!te.length)return _("missing open tag");if(l=O=te.pop(),y=I+2+l.length,S.substring(I+2,y)!==l)return _("closing tag mismatch");for(;y<R;y++)if(!((x=S.charCodeAt(y))===32||x>8&&x<14))return _("close tag")}else{if(S.charCodeAt(R-1)===47?(l=O=S.substring(I+1,R-1),oe=!0,ne=!0):(l=O=S.substring(I+1,R),oe=!0,ne=!1),!(x>96&&x<123||x>64&&x<91||x===95||x===58))return _("illegal first char nodeName");for(y=1,h=l.length;y<h;y++)if(!((x=l.charCodeAt(y))>96&&x<123||x>64&&x<91||x>47&&x<59||x===45||x===95||x==46)){if(x===32||x<14&&x>8){O=l.substring(0,y),q=null;break}return _("invalid nodeName")}ne||te.push(O)}if(v){if(k=V,oe&&(ne||U.push(k),q===null&&(f=l.indexOf("xmlns",y)!==-1)&&(L=y,M=l,K(),f=!1)),B=O,(x=O.indexOf(":"))!==-1){if(!(N=V[O.substring(0,x)]))return _("missing namespace on <"+B+">");O=O.substr(x+1)}else N=V.xmlns;N&&(O=N+":"+O)}if(oe&&(L=y,M=l,n&&(p?n(H,pr,ne,m):n(O,K,pr,ne,m),E)))return;if(ne){if(i&&(i(p?H:O,pr,oe,m),E))return;v&&(V=oe?k:U.pop())}R+=1}else{if(c&&(c(S.substring(I,R+1),pr,m),E))return;R+=1}}else{if((R=S.indexOf("?>",I))===-1)return _("unclosed question");if(s&&(s(S.substring(I,R+2),m),E))return;R+=2}}}(w),m=zm,E=!1,g},this.stop=function(){E=!0}}function Hm(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var K_={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},gs="xsi:type";function Gm(e){return e.xml&&e.xml.serialize}function Wm(e){return Gm(e)===gs}function qm(e,t){return Hm(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Mi(e){return new Error(e)}function ni(e){return e.$descriptor}function X_(e){z(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw Mi("expected element");var n,i=this.elementsById,r=ni(t).idProperty;if(r&&(n=t.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(n))throw new Error("illegal ID <"+n+">");if(i[n])throw Mi("duplicate ID <"+n+">");i[n]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Uo(){}function du(){}function qr(){}function Ho(e,t){this.property=e,this.context=t}function hu(e,t){this.element=t,this.propertyDesc=e}function bs(){}function Dt(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function mu(e,t,n){Dt.call(this,e,t,n)}function Kr(e,t,n){this.model=e,this.context=n}function fu(e){e instanceof dn&&(e={model:e}),z(this,{lax:!1},e)}Uo.prototype.handleEnd=function(){},Uo.prototype.handleText=function(){},Uo.prototype.handleNode=function(){},du.prototype=Object.create(Uo.prototype),du.prototype.handleNode=function(){return this},qr.prototype=Object.create(Uo.prototype),qr.prototype.handleText=function(e){this.body=(this.body||"")+e},Ho.prototype=Object.create(qr.prototype),Ho.prototype.handleNode=function(e){if(this.element)throw Mi("expected no sub nodes");return this.element=this.createReference(e),this},Ho.prototype.handleEnd=function(){this.element.id=this.body},Ho.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},hu.prototype=Object.create(qr.prototype),hu.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=lu(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},bs.prototype=Object.create(qr.prototype),bs.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},Dt.prototype=Object.create(bs.prototype),Dt.prototype.addReference=function(e){this.context.addReference(e)},Dt.prototype.handleText=function(e){if(!ni(this.element).bodyProperty)throw Mi("unexpected body text <"+e+">");qr.prototype.handleText.call(this,e)},Dt.prototype.handleEnd=function(){var e=this.body,t=this.element,n=ni(t).bodyProperty;n&&e!==void 0&&(e=lu(n.type,e),t.set(n.name,e))},Dt.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 $(n,function(c,u){var p=r.propertiesByName[u];p&&p.isReference?p.isMany?$(c.split(" "),function(d){o.addReference({element:a,property:p.ns.name,id:d})}):o.addReference({element:a,property:p.ns.name,id:c}):(p?c=lu(p.type,c):u!=="xmlns"&&(t=Bt(u,r.ns.prefix),s.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+u+">",element:a,property:u,value:c})),a.set(u,c))}),a},Dt.prototype.getPropertyForNode=function(e){var t,n,i=Bt(e.name),r=this.type,o=this.model,a=ni(r),s=i.name,c=a.propertiesByName[s];if(c&&!c.isAttr)return Wm(c)&&(t=e.attributes[gs])?(t=function(p,d){var m=Bt(p);return function(f,v){var g=f.name,E=f.localName,_=v.xml&&v.xml.typePrefix;return _&&E.indexOf(_)===0?f.prefix+":"+E.slice(_.length):g}(m,d.getPackage(m.prefix))}(t,o),z({},c,{effectiveType:ni(n=o.getType(t)).name})):c;var u=o.getPackage(i.prefix);if(u){if(t=qm(i,u),n=o.getType(t),c=Be(a.properties,function(p){return!p.isVirtual&&!p.isReference&&!p.isAttribute&&n.hasType(p.type)}))return z({},c,{effectiveType:ni(n).name})}else if(c=Be(a.properties,function(p){return!p.isReference&&!p.isAttribute&&p.type==="Element"}))return c;throw Mi("unrecognized element <"+i.name+">")},Dt.prototype.toString=function(){return"ElementDescriptor["+ni(this.type).name+"]"},Dt.prototype.valueHandler=function(e,t){return new hu(e,t)},Dt.prototype.referenceHandler=function(e){return new Ho(e,this.context)},Dt.prototype.handler=function(e){return e==="Element"?new Kr(this.model,e,this.context):new Dt(this.model,e,this.context)},Dt.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Om(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return o!==void 0&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(z(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},mu.prototype=Object.create(Dt.prototype),mu.prototype.createElement=function(e){var t=e.name,n=Bt(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&qm(n,o)||t;if(!r.hasType(a))throw Mi("unexpected element <"+e.originalName+">");return Dt.prototype.createElement.call(this,e)},Kr.prototype=Object.create(bs.prototype),Kr.prototype.createElement=function(e){var t=e.name,n=Bt(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Kr.prototype.handleChild=function(e){var t=new Kr(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return i!==void 0&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},Kr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},fu.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof Dt?(i=t,t={}):typeof t=="string"?(i=this.handler(t),t={}):typeof i=="string"&&(i=this.handler(i));var r=this.model,o=this.lax,a=new X_(z({},t,{rootHandler:i})),s=new Um({proxy:!0}),c=function(){var E=[];return Object.defineProperty(E,"peek",{value:function(){return this[this.length-1]}}),E}();function u(E,_,b){var w=_(),S=w.line,k=w.column,l=w.data;l.charAt(0)==="<"&&l.indexOf(" ")!==-1&&(l=l.slice(0,l.indexOf(" "))+">");var h="unparsable content "+(l?l+" ":"")+`detected
  2. line: `+S+`
  3. column: `+k+`
  4. nested error: `+E.message;if(b)return a.addWarning({message:h,error:E}),!0;throw Mi(h)}function p(E,_){return u(E,_,!0)}i.context=a,c.push(i);var d=/^<\?xml /i,m=/ encoding="([^"]+)"/i,f=/^utf-8$/i;function v(E,_){try{c.peek().handleText(E)}catch(b){p(b,_)}}var g=r.getPackages().reduce(function(E,_){return E[_.uri]=_.prefix,E},{"http://www.w3.org/XML/1998/namespace":"xml"});return s.ns(g).on("openTag",function(E,_,b,w){var S=E.attrs||{},k=Object.keys(S).reduce(function(l,h){var y=_(S[h]);return l[h]=y,l},{});(function(l,h){var y=c.peek();try{c.push(y.handleNode(l))}catch(x){u(x,h,o)&&c.push(new du)}})({name:E.name,originalName:E.originalName,attributes:k,ns:E.ns},w)}).on("question",function(E){if(d.test(E)){var _=m.exec(E),b=_&&_[1];b&&!f.test(b)&&a.addWarning({message:"unsupported document encoding <"+b+">, falling back to UTF-8"})}}).on("closeTag",function(){c.pop().handleEnd()}).on("cdata",v).on("text",function(E,_,b){(function(w,S){w.trim()&&v(w,S)})(_(E),b)}).on("error",u).on("warn",p),new Promise(function(E,_){var b;try{s.parse(e),function(){var h,y,x=a.elementsById,C=a.references;for(h=0;y=C[h];h++){var N=y.element,O=x[y.id],B=ni(N).propertiesByName[y.property];if(O||a.addWarning({message:"unresolved reference <"+y.id+">",element:y.element,property:y.property,value:y.id}),B.isMany){var H=N.get(B.name),q=H.indexOf(y);q===-1&&(q=H.length),O?H[q]=O:H.splice(q,1)}else N.set(B.name,O)}}()}catch(h){b=h}var w=i.element;b||w||(b=Mi("failed to parse document as <"+i.type.$descriptor.name+">"));var S=a.warnings,k=a.references,l=a.elementsById;return b?(b.warnings=S,_(b)):E({rootElement:w,elementsById:l,references:k,warnings:S})})},fu.prototype.handler=function(e){return new mu(this.model,e)};var Y_=/<|>|'|"|&|\n\r|\n/g,Km=/<|>|&/g;function J_(e){var t={},n={},i={},r=[],o=[];this.byUri=function(a){return n[a]||e&&e.byUri(a)},this.add=function(a,s){n[a.uri]=a,s?r.push(a):o.push(a),this.mapPrefix(a.prefix,a.uri)},this.uriByPrefix=function(a){return t[a||"xmlns"]},this.mapPrefix=function(a,s){t[a||"xmlns"]=s},this.getNSKey=function(a){return a.prefix!==void 0?a.uri+"|"+a.prefix:a.uri},this.logUsed=function(a){var s=a.uri,c=this.getNSKey(a);i[c]=this.byUri(s),e&&e.logUsed(a)},this.getUsed=function(a){var s=this;return[].concat(r,o).filter(function(c){var u=s.getNSKey(c);return i[u]})}}function Xm(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Ym(e){return Ut(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var Z_={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Q_={"<":"lt",">":"gt","&":"amp"};function Jm(e,t,n){return(e=Ut(e)?e:""+e).replace(t,function(i){return"&"+n[i]+";"})}function vu(e){this.tagName=e}function dr(){}function yu(e){this.tagName=e}function Xe(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function xs(e,t){Xe.call(this,e,t)}function eE(){this.value="",this.write=function(e){this.value+=e}}function tE(e,t){var n=[""];this.append=function(i){return e.write(i),this},this.appendNewLine=function(){return t&&e.write(`
  5. `),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 nE(e){return e=z({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new eE,r=new tE(i,e.format);if(e.preamble&&r.append(`<?xml version="1.0" encoding="UTF-8"?>
  6. `),new Xe().build(t).serializeTo(r),!n)return i.value}}}function _s(e,t){dn.call(this,e,t)}vu.prototype.build=function(e){return this.element=e,this},vu.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},dr.prototype.serializeValue=dr.prototype.serializeTo=function(e){e.append(this.escape?Jm(this.value,Km,Q_):this.value)},dr.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(Km)!==-1&&(this.escape=!0),this},Xm(yu,dr),yu.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Xe.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(a){return Ce(a.$descriptor.properties,function(s){var c=s.name;if(s.isVirtual||!Lt(a,c))return!1;var u=a[c];return u!==s.default&&u!==null&&(!s.isMany||u.length)})}(e),this.parseAttributes(Ce(n,function(a){return a.isAttr})),this.parseContainments(Ce(n,function(a){return!a.isAttr}))),this.parseGenericAttributes(e,t),this},Xe.prototype.nsTagName=function(e){return function(t,n){return n.isGeneric?z({localName:n.ns.localName},t):z({localName:(i=n.ns.localName,r=n.$pkg,Hm(r)?(o=i).charAt(0).toLowerCase()+o.slice(1):i)},t);var i,r,o}(this.logNamespaceUsed(e.ns),e)},Xe.prototype.nsPropertyTagName=function(e){return function(t,n){return z({localName:n.ns.localName},t)}(this.logNamespaceUsed(e.ns),e)},Xe.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Xe.prototype.nsAttributeName=function(e){var t;if(t=Ut(e)?Bt(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:z({localName:t.localName},n)},Xe.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return $(e,function(r,o){o==="$body"?n.push(new dr().build({type:"String"},r)):o==="$children"?$(r,function(a){n.push(new Xe(t).build(a))}):o.indexOf("$")!==0&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})}),i},Xe.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=Bt(t);if(o.prefix==="xmlns"&&(i={prefix:o.localName,uri:n}),o.prefix||o.localName!=="xmlns"||(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)}},Xe.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return $(i,function(o,a){var s=n.parseNsAttribute(e,a,o);s&&r.push(s)}),r},Xe.prototype.parseGenericAttributes=function(e,t){var n=this;$(t,function(i){if(i.name!==gs)try{n.addAttribute(n.nsAttributeName(i.name),i.value)}catch(r){console.warn("missing namespace information for ",i.name,"=",i.value,"on",e,r)}})},Xe.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;$(e,function(r){var o=i.get(r.name),a=r.isReference;if(r.isMany||(o=[o]),r.isBody)n.push(new dr().build(r,o[0]));else if(Om(r.type))$(o,function(u){n.push(new yu(t.addTagName(t.nsPropertyTagName(r))).build(r,u))});else if(a)$(o,function(u){n.push(new vu(t.addTagName(t.nsPropertyTagName(r))).build(u))});else{var s=Wm(r),c=function(u){return Gm(u)==="property"}(r);$(o,function(u){var p;p=s?new xs(t,r):c?new Xe(t,r):new Xe(t),n.push(p.build(u))})}})},Xe.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new J_(t):n=t),n},Xe.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},Xe.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,a=this.getNamespaces(t),s=e.prefix,c=e.uri;if(!s&&!c)return{localName:e.localName};if(r=K_[s]||o&&(o.getPackage(s)||{}).uri,!(c=c||r||a.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=a.byUri(c))){for(n=s,i=1;a.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:c},r===c)}return s&&a.mapPrefix(s,c),e},Xe.prototype.parseAttributes=function(e){var t=this,n=this.element;$(e,function(i){var r=n.get(i.name);if(i.isReference)if(i.isMany){var o=[];$(r,function(a){o.push(a.id)}),r=o.join(" ")}else r=r.id;t.addAttribute(t.nsAttributeName(i),r)})},Xe.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Ym(e)},Xe.prototype.addAttribute=function(e,t){var n=this.attrs;Ut(t)&&(t=Jm(t,Y_,Z_));var i=jh(n,function(o){return o.name.localName===e.localName&&o.name.uri===e.uri&&o.name.prefix===e.prefix}),r={name:e,value:t};i!==-1?n.splice(i,1,r):n.push(r)},Xe.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(i){return i.getUsed().filter(function(r){return r.prefix!=="xml"}).map(function(r){return{name:"xmlns"+(r.prefix?":"+r.prefix:""),value:r.uri}})}(n).concat(t)),$(t,function(i){e.append(" ").append(Ym(i.name)).append('="').append(i.value).append('"')})},Xe.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==dr;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),$(this.body,function(i){i.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},Xm(xs,Xe),xs.prototype.parseNsAttributes=function(e){var t=Xe.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(gs),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},xs.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},_s.prototype=Object.create(dn.prototype),_s.prototype.fromXML=function(e,t,n){Ut(t)||(n=t,t="bpmn:Definitions");var i=new fu(z({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},_s.prototype.toXML=function(e,t){var n=new nE(t);return new Promise(function(i,r){try{return i({xml:n.toXML(e)})}catch(o){return r(o)}})};var iE={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function rE(e,t){return new _s(z({},iE,e),t)}function Pt(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function Zm(e){Lt(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error("Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472")}})}function Vt(e,t){return e.$instanceOf(t)}function oE(e){var t={},n=[],i={};function r(x,C){return function(N){x(N,C)}}function o(x){t[x.id]=x}function a(x,C){try{var N=i[x.id]&&function(O,B){if(O.gfx)throw new Error(`already rendered ${Pt(O)}`);return e.element(O,i[O.id],B)}(x,C);return o(x),N}catch(O){s(O.message,{element:x,error:O}),console.error(`failed to import ${Pt(x)}`,O)}}function s(x,C){e.error(x,C)}var c=this.registerDi=function(x){var C=x.bpmnElement;C?i[C.id]?s(`multiple DI elements defined for ${Pt(C)}`,{element:C}):(i[C.id]=x,Zm(C)):s(`no bpmnElement referenced in ${Pt(x)}`,{element:x})};function u(x){c(x)}this.handleDefinitions=function(x,C){var N=x.diagrams;if(C&&N.indexOf(C)===-1)throw new Error("diagram not part of <bpmn:Definitions />");if(!C&&N&&N.length&&(C=N[0]),!C)throw new Error("no diagram to display");i={},function(V){var te;te=V.plane,c(te),$(te.planeElement,u)}(C);var O=C.plane;if(!O)throw new Error(`no plane for ${Pt(C)}`);var B=O.bpmnElement;if(!B){if(B=function(V){return Be(V.rootElements,function(te){return Vt(te,"bpmn:Process")||Vt(te,"bpmn:Collaboration")})}(x),!B)throw new Error("no process or collaboration to display");s(`correcting missing bpmnElement on ${Pt(O)} to ${Pt(B)}`),O.bpmnElement=B,c(O)}var H,q,U=function(V,te){return e.root(V,i[V.id],te)}(B,O);if(Vt(B,"bpmn:Process")||Vt(B,"bpmn:SubProcess"))d(B,U);else{if(!Vt(B,"bpmn:Collaboration"))throw new Error(`unsupported bpmnElement for ${Pt(O)}: ${Pt(B)}`);q=U,$((H=B).participants,r(y,q)),_(H.artifacts,q),n.push(function(){(function(V,te){$(V,r(m,te))})(H.messageFlows,q)}),function(V,te){var X=Ce(V,function(oe){return!t[oe.id]&&Vt(oe,"bpmn:Process")&&oe.laneSets});X.forEach(r(d,te))}(x.rootElements,U)}p(n)};var p=this.handleDeferred=function(){for(;n.length;)n.shift()()};function d(x,C){h(x,C),b(x.ioSpecification,C),_(x.artifacts,C),o(x)}function m(x,C){a(x,C)}function f(x,C){a(x,C)}function v(x,C){a(x,C)}function g(x,C){a(x,C)}function E(x,C){a(x,C)}function _(x,C){$(x,function(N){Vt(N,"bpmn:Association")?n.push(function(){E(N,C)}):E(N,C)})}function b(x,C){x&&($(x.dataInputs,r(v,C)),$(x.dataOutputs,r(g,C)))}var w=this.handleSubProcess=function(x,C){h(x,C),_(x.artifacts,C)};function S(x,C){var N=a(x,C);Vt(x,"bpmn:SubProcess")&&w(x,N||C),Vt(x,"bpmn:Activity")&&b(x.ioSpecification,C),n.push(function(){$(x.dataInputAssociations,r(f,C)),$(x.dataOutputAssociations,r(f,C))})}function k(x,C){n.push(function(){var N=a(x,C);x.childLaneSet&&l(x.childLaneSet,N||C),function(O){$(O.flowNodeRef,function(B){var H=B.get("lanes");H&&H.push(O)})}(x)})}function l(x,C){$(x.lanes,r(k,C))}function h(x,C){(function(N,O){$(N,function(B){Vt(B,"bpmn:SequenceFlow")?n.push(function(){(function(H,q){a(H,q)})(B,O)}):Vt(B,"bpmn:BoundaryEvent")?n.unshift(function(){S(B,O)}):Vt(B,"bpmn:FlowNode")?S(B,O):Vt(B,"bpmn:DataObject")||(Vt(B,"bpmn:DataStoreReference")||Vt(B,"bpmn:DataObjectReference")?function(H,q){a(H,q)}(B,O):s(`unrecognized flowElement ${Pt(B)} in context ${Pt(O&&O.businessObject)}`,{element:B,context:O}))})})(x.flowElements,C),x.laneSets&&function(N,O){$(N,r(l,O))}(x.laneSets,C)}function y(x,C){var N=a(x,C),O=x.processRef;O&&d(O,N||C)}}function P(e,t){var n=Q(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function Se(e,t){return Gt(t,function(n){return P(e,n)})}function Q(e){return e&&e.businessObject||e}function Me(e){return e&&e.di}function aE(e,t,n){var i,r,o,a=[];function s(c,u){var p=new oE({root:function(f,v){return i.add(f,v)},element:function(f,v,g){return i.add(f,v,g)},error:function(f,v){a.push({message:f,context:v})}});u=u||c.diagrams&&c.diagrams[0];var d=function(f,v){if(v&&v.plane){var g,E=v.plane.bpmnElement,_=E;P(E,"bpmn:Process")||P(E,"bpmn:Collaboration")||(_=function(l){for(var h=l;h;){if(P(h,"bpmn:Process"))return h;h=h.$parent}}(E)),g=P(_,"bpmn:Collaboration")?_:Be(f.rootElements,function(l){if(P(l,"bpmn:Collaboration"))return Be(l.participants,function(h){return h.processRef===_})});var b=[_];g&&(b=kt(g.participants,function(l){return l.processRef})).push(g);var w=Qm(b),S=[v],k=[E];return $(f.diagrams,function(l){if(l.plane){var h=l.plane.bpmnElement;w.indexOf(h)!==-1&&k.indexOf(h)===-1&&(S.push(l),k.push(h))}}),S}}(c,u);if(!d)throw new Error("no diagram to display");$(d,function(f){p.handleDefinitions(c,f)});var m=u.plane.bpmnElement.id;o.setRootElement(o.findRoot(m+"_plane")||o.findRoot(m))}return new Promise(function(c,u){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("canvas"),r.fire("import.render.start",{definitions:t}),s(t,n),r.fire("import.render.complete",{error:void 0,warnings:a}),c({warnings:a})}catch(p){return p.warnings=a,u(p)}})}function Qm(e){var t=[];return $(e,function(n){n&&(t.push(n),t=t.concat(Qm(n.flowElements)))}),t}var ii,ef='<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>',tf={verticalAlign:"middle"},nf={color:"#404040"},sE={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},lE={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},cE={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"},uE='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+ef+'</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>';function Ye(e){e=z({},pE,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),function(t){const n=He('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+ef+"</a>");At(Ve("svg",n),tf),At(n,nf,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),t.appendChild(n),ve.bind(n,"click",function(i){ii||(At(ii=He(uE),sE),At(Ve("svg",ii),tf),At(Ve(".backdrop",ii),lE),At(Ve(".notice",ii),cE),At(Ve(".link",ii),nf,{margin:"15px 20px 15px 10px",alignSelf:"center"}),un(ii,".backdrop","click",function(r){document.body.removeChild(ii)})),document.body.appendChild(ii),i.preventDefault()})}(this._container),this._init(this._container,this._moddle,e)}function Es(e,t){return e.warnings=t,e}le(Ye,Pi),Ye.prototype.importXML=async function(e,t){const n=this;let i=[];try{let o;e=this._emit("import.parse.start",{xml:e})||e;try{o=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(d){throw this._emit("import.parse.complete",{error:d}),d}let a=o.rootElement;const s=o.references,c=o.warnings,u=o.elementsById;i=i.concat(c),a=this._emit("import.parse.complete",(r={error:null,definitions:a,elementsById:u,references:s,warnings:i},n.get("eventBus").createEvent(r)))||a;const p=await this.importDefinitions(a,t);return i=i.concat(p.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(o){let a=o;throw i=i.concat(a.warnings||[]),Es(a,i),a=function(s){const c=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(s.message);return c&&(s.message="unparsable content <"+c[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+c[2]),s}(a),this._emit("import.done",{error:a,warnings:a.warnings}),a}var r},Ye.prototype.importDefinitions=async function(e,t){return this._setDefinitions(e),{warnings:(await this.open(t)).warnings}},Ye.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const r=new Error("no XML imported");throw Es(r,[]),r}if(typeof e=="string"&&(n=function(r,o){return o&&Be(r.diagrams,function(a){return a.id===o})||null}(t,e),!n)){const r=new Error("BPMNDiagram <"+e+"> not found");throw Es(r,[]),r}try{this.clear()}catch(r){throw Es(r,[]),r}const{warnings:i}=await aE(this,t,n);return{warnings:i}},Ye.prototype.saveXML=async function(e){e=e||{};let t,n,i=this._definitions;try{if(!i)throw new Error("no definitions loaded");i=this._emit("saveXML.start",{definitions:i})||i,n=(await this._moddle.toXML(i,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(o){t=o}const r=t?{error:t}:{xml:n};if(this._emit("saveXML.done",r),t)throw t;return r},Ye.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const n=this.get("canvas"),i=n.getActiveLayer(),r=Ve(":scope > defs",n._svg),o=em(i),a=r?"<defs>"+em(r)+"</defs>":"",s=i.getBBox();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="`+s.width+'" height="'+s.height+'" viewBox="'+s.x+" "+s.y+" "+s.width+" "+s.height+'" version="1.1">'+a+o+"</svg>"}catch(n){t=n}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},Ye.prototype._setDefinitions=function(e){this._definitions=e},Ye.prototype.getModules=function(){return this._modules},Ye.prototype.clear=function(){this.getDefinitions()&&Pi.prototype.clear.call(this)},Ye.prototype.destroy=function(){Pi.prototype.destroy.call(this),Fn(this._container)},Ye.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},Ye.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Ye.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=Ve(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Ye.prototype.getDefinitions=function(){return this._definitions},Ye.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Ye.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),a=z(cn(n,["additionalModules"]),{canvas:z({},n.canvas,{container:e}),modules:o});Pi.call(this,a),n&&n.container&&this.attachTo(n.container)},Ye.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Ye.prototype._createContainer=function(e){const t=He('<div class="bjs-container"></div>');return At(t,{width:rf(e.width),height:rf(e.height),position:e.position}),t},Ye.prototype._createModdle=function(e){return new rE(z({},this._moddleExtensions,e.moddleExtensions))},Ye.prototype._modules=[];const pE={width:"100%",height:"100%",position:"relative"};function rf(e){return e+(ye(e)?"px":"")}function Go(e){Ye.call(this,e),this.on("import.parse.complete",function(t){t.error||this._collectIds(t.definitions,t.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}function Ae(e,t){return!P(e,"bpmn:CallActivity")&&(P(e,"bpmn:SubProcess")?!(!(t=t||Me(e))||!P(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!P(e,"bpmn:Participant")||!!Q(e).processRef)}function gt(e){if(P(e,"bpmn:Participant")||P(e,"bpmn:Lane")){var t=Me(e).isHorizontal;return t===void 0||t}}function wt(e){return e&&!!Q(e).triggeredByEvent}function Xr(e,t){return Gt(Q(e).eventDefinitions,function(n){return P(n,t)})}le(Go,Ye),Go.prototype._createModdle=function(e){var t=Ye.prototype._createModdle.call(this,e);return t.ids=new Vn([32,36,1]),t},Go.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var Wo={width:90,height:20};function hr(e){return P(e,"bpmn:Event")||P(e,"bpmn:Gateway")||P(e,"bpmn:DataStoreReference")||P(e,"bpmn:DataObjectReference")||P(e,"bpmn:DataInput")||P(e,"bpmn:DataOutput")||P(e,"bpmn:SequenceFlow")||P(e,"bpmn:MessageFlow")||P(e,"bpmn:Group")}function ws(e){return Re(e.label)}function gu(e){return e.waypoints?function(t){var n=t.length/2-1,i=t[Math.floor(n)],r=t[Math.ceil(n+.01)],o=function(u){var p=u.length/2-1,d=u[Math.floor(p)],m=u[Math.ceil(p+.01)];return{x:d.x+(m.x-d.x)/2,y:d.y+(m.y-d.y)/2}}(t),a=Math.atan((r.y-i.y)/(r.x-i.x)),s=o.x,c=o.y;return Math.abs(a)<Math.PI/2?c-=15:s+=15,{x:s,y:c}}(e.waypoints):P(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+Wo.height/2}:{x:e.x+e.width/2,y:e.y+e.height+Wo.height/2}}function of(e){return P(e,"bpmn:FlowElement")||P(e,"bpmn:Participant")||P(e,"bpmn:Lane")||P(e,"bpmn:SequenceFlow")||P(e,"bpmn:MessageFlow")||P(e,"bpmn:DataInput")||P(e,"bpmn:DataOutput")?"name":P(e,"bpmn:TextAnnotation")?"text":P(e,"bpmn:Group")?"categoryValueRef":void 0}function tn(e){var t=e.businessObject,n=of(t);if(n)return n==="categoryValueRef"?function(i){var r=i.categoryValueRef;return r&&r.value||""}(t):t[n]||""}var bu="hsl(225, 10%, 15%)";function Hn(e,t){return Gt(e.eventDefinitions,function(n){return n.$type===t})}function ke(e,t,n){var i=Me(e);return n||i.get("color:background-color")||i.get("bioc:fill")||t||"white"}function se(e,t,n){var i=Me(e);return n||i.get("color:border-color")||i.get("bioc:stroke")||t||bu}function qo(e,t,n,i){var r=Me(e).get("label");return i||r&&r.get("color:color")||t||se(e,n)}function Ko(e,t={}){return{width:hn(e,t),height:qt(e,t)}}function hn(e,t={}){return Lt(t,"width")?t.width:e.width}function qt(e,t={}){return Lt(t,"height")?t.height:e.height}var dE=new Vn,Yr=.95;function mr(e,t,n,i,r,o,a){Qn.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,u=e&&e.defaultLabelColor;function p(I){return n.computeStyle(I,{strokeLinecap:"round",strokeLinejoin:"round",stroke:bu,strokeWidth:2,fill:"white"})}function d(I){return n.computeStyle(I,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:bu,strokeWidth:2})}function m(I,R){var{ref:M={x:0,y:0},scale:L=1,element:K,parentGfx:j=r._svg}=R,G=ue("marker",{id:I,viewBox:"0 0 20 20",refX:M.x,refY:M.y,markerWidth:20*L,markerHeight:20*L,orient:"auto"});xe(G,K);var J=Ve(":scope > defs",j);J||xe(j,J=ue("defs")),xe(J,G)}function f(I,R,M,L){var K=dE.nextPrefixed("marker-");return function(j,G,J,Y,he){J==="sequenceflow-end"&&m(G,{element:ue("path",{d:"M 1 5 L 11 10 L 1 15 Z",...p({fill:he,stroke:he,strokeWidth:1})}),ref:{x:11,y:10},scale:.5,parentGfx:j}),J==="messageflow-start"&&m(G,{element:ue("circle",{cx:6,cy:6,r:3.5,...p({fill:Y,stroke:he,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6},parentGfx:j}),J==="messageflow-end"&&m(G,{element:ue("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...p({fill:Y,stroke:he,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5},parentGfx:j}),J==="association-start"&&m(G,{element:ue("path",{d:"M 11 5 L 1 10 L 11 15",...d({fill:"none",stroke:he,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5,parentGfx:j}),J==="association-end"&&m(G,{element:ue("path",{d:"M 1 5 L 11 10 L 1 15",...d({fill:"none",stroke:he,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5,parentGfx:j}),J==="conditional-flow-marker"&&m(G,{element:ue("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...p({fill:Y,stroke:he})}),ref:{x:-1,y:10},scale:.5,parentGfx:j}),J==="conditional-default-flow-marker"&&m(G,{element:ue("path",{d:"M 6 4 L 10 16",...p({stroke:he,fill:"none"})}),ref:{x:0,y:10},scale:.5,parentGfx:j})}(I,K,R,M,L),"url(#"+K+")"}function v(I,R,M,L,K={}){vt(L)&&(K=L,L=0),L=L||0,K=p(K);var j=ue("circle",{cx:R/2,cy:M/2,r:Math.round((R+M)/4-L),...K});return xe(I,j),j}function g(I,R,M,L,K,j){vt(K)&&(j=K,K=0),K=K||0,j=p(j);var G=ue("rect",{x:K,y:K,width:R-2*K,height:M-2*K,rx:L,ry:L,...j});return xe(I,G),G}function E(I,R,M,L){var K=ss(R,M=d(M),L);return xe(I,K),K}function _(I,R,M){return E(I,R,M,5)}function b(I,R,M){M=d(M);var L=ue("path",{...M,d:R});return xe(I,L),L}function w(I,R,M,L){return b(R,M,z({"data-marker":I},L))}function S(I){return ne[I]}function k(I){return function(R,M,L){return S(I)(R,M,L)}}function l(I,R,M={}){var L=Q(I),K=function(j){return j.$type==="bpmn:IntermediateThrowEvent"||j.$type==="bpmn:EndEvent"}(L);return L.get("eventDefinitions")&&L.get("eventDefinitions").length>1?L.get("parallelMultiple")?function(j,G,J={}){return b(j,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:G.width,containerHeight:G.height,position:{mx:.458,my:.194}}),{fill:ke(G,s,J.fill),stroke:se(G,c,J.stroke),strokeWidth:1})}(R,I,M):function(j,G,J={},Y){return b(j,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:G.width,containerHeight:G.height,position:{mx:.222,my:.36}}),{fill:Y?se(G,c,J.stroke):ke(G,s,J.fill),strokeWidth:1})}(R,I,M,K):Hn(L,"bpmn:MessageEventDefinition")?function(j,G,J={},Y){return b(j,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:G.width,containerHeight:G.height,position:{mx:.235,my:.315}}),{fill:Y?se(G,c,J.stroke):ke(G,s,J.fill),stroke:Y?ke(G,s,J.fill):se(G,c,J.stroke),strokeWidth:1})}(R,I,M,K):Hn(L,"bpmn:TimerEventDefinition")?function(j,G,J={}){var Y=v(j,G.width,G.height,.2*G.height,{fill:ke(G,s,J.fill),stroke:se(G,c,J.stroke),strokeWidth:2});b(j,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:G.width,containerHeight:G.height,position:{mx:.5,my:.5}}),{stroke:se(G,c,J.stroke),strokeWidth:2});for(var he=0;he<12;he++){var be=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:G.width,containerHeight:G.height,position:{mx:.5,my:.5}}),je=G.width/2,De=G.height/2;b(j,be,{strokeWidth:1,stroke:se(G,c,J.stroke),transform:"rotate("+30*he+","+De+","+je+")"})}return Y}(R,I,M):Hn(L,"bpmn:ConditionalEventDefinition")?function(j,G,J={}){return b(j,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:G.width,containerHeight:G.height,position:{mx:.5,my:.222}}),{fill:ke(G,s,J.fill),stroke:se(G,c,J.stroke),strokeWidth:1})}(R,I,M):Hn(L,"bpmn:SignalEventDefinition")?function(j,G,J={},Y){return b(j,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:G.width,containerHeight:G.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:Y?se(G,c,J.stroke):ke(G,s,J.fill),stroke:se(G,c,J.stroke)})}(R,I,M,K):Hn(L,"bpmn:EscalationEventDefinition")?function(j,G,J={},Y){return b(j,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:G.width,containerHeight:G.height,position:{mx:.5,my:.2}}),{fill:Y?se(G,c,J.stroke):ke(G,s,J.fill),stroke:se(G,c,J.stroke),strokeWidth:1})}(R,I,M,K):Hn(L,"bpmn:LinkEventDefinition")?function(j,G,J={},Y){return b(j,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:G.width,containerHeight:G.height,position:{mx:.57,my:.263}}),{fill:Y?se(G,c,J.stroke):ke(G,s,J.fill),stroke:se(G,c,J.stroke),strokeWidth:1})}(R,I,M,K):Hn(L,"bpmn:ErrorEventDefinition")?function(j,G,J={},Y){return b(j,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:G.width,containerHeight:G.height,position:{mx:.2,my:.722}}),{fill:Y?se(G,c,J.stroke):ke(G,s,J.fill),stroke:se(G,c,J.stroke),strokeWidth:1})}(R,I,M,K):Hn(L,"bpmn:CancelEventDefinition")?function(j,G,J={},Y){var he=b(j,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:G.width,containerHeight:G.height,position:{mx:.638,my:-.055}}),{fill:Y?se(G,c,J.stroke):"none",stroke:se(G,c,J.stroke),strokeWidth:1});return Nm(he,45),he}(R,I,M,K):Hn(L,"bpmn:CompensateEventDefinition")?function(j,G,J={},Y){return b(j,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:G.width,containerHeight:G.height,position:{mx:.22,my:.5}}),{fill:Y?se(G,c,J.stroke):ke(G,s,J.fill),stroke:se(G,c,J.stroke),strokeWidth:1})}(R,I,M,K):Hn(L,"bpmn:TerminateEventDefinition")?function(j,G,J={}){return v(j,G.width,G.height,8,{fill:se(G,c,J.stroke),stroke:se(G,c,J.stroke),strokeWidth:4})}(R,I,M):null}var h={ParticipantMultiplicityMarker:function(I,R,M={}){var L=hn(R,M),K=qt(R,M);w("participant-multiplicity",I,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:L,containerHeight:K,position:{mx:(L/2-6)/L,my:(K-15)/K}}),{strokeWidth:2,fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke)})},SubProcessMarker:function(I,R,M={}){Et(g(I,14,14,0,{strokeWidth:1,fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke)}),R.width/2-7.5,R.height-20),w("sub-process",I,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:R.width,containerHeight:R.height,position:{mx:(R.width/2-7.5)/R.width,my:(R.height-20)/R.height}}),{fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke)})},ParallelMarker:function(I,R,M){var L=hn(R,M),K=qt(R,M);w("parallel",I,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:L,containerHeight:K,position:{mx:(L/2+M.parallel)/L,my:(K-20)/K}}),{fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke)})},SequentialMarker:function(I,R,M){w("sequential",I,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:R.width,containerHeight:R.height,position:{mx:(R.width/2+M.seq)/R.width,my:(R.height-19)/R.height}}),{fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke)})},CompensationMarker:function(I,R,M){w("compensation",I,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:R.width,containerHeight:R.height,position:{mx:(R.width/2+M.compensation)/R.width,my:(R.height-13)/R.height}}),{strokeWidth:1,fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke)})},LoopMarker:function(I,R,M){var L=hn(R,M),K=qt(R,M);w("loop",I,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:L,containerHeight:K,position:{mx:(L/2+M.loop)/L,my:(K-7)/K}}),{strokeWidth:1.5,fill:"none",stroke:se(R,c,M.stroke),strokeMiterlimit:.5})},AdhocMarker:function(I,R,M){var L=hn(R,M),K=qt(R,M);w("adhoc",I,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:L,containerHeight:K,position:{mx:(L/2+M.adhoc)/L,my:(K-15)/K}}),{strokeWidth:1,fill:se(R,c,M.stroke),stroke:se(R,c,M.stroke)})}};function y(I,R,M,L){h[I](R,M,L)}function x(I,R,M,L={}){L={fill:L.fill,stroke:L.stroke,width:hn(R,L),height:qt(R,L)};var K=Q(R),j=M&&M.includes("SubProcessMarker");L=j?{...L,seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{...L,seq:-5,parallel:-6,compensation:-27,loop:0,adhoc:10},$(M,function(Y){y(Y,I,R,L)}),K.get("isForCompensation")&&y("CompensationMarker",I,R,L),P(K,"bpmn:AdHocSubProcess")&&y("AdhocMarker",I,R,L);var G=K.get("loopCharacteristics"),J=G&&G.get("isSequential");G&&(J===void 0&&y("LoopMarker",I,R,L),J===!1&&y("ParallelMarker",I,R,L),J===!0&&y("SequentialMarker",I,R,L))}function C(I,R,M={}){M=z({size:{width:100}},M);var L=o.createText(R||"",M);return Pe(L).add("djs-label"),xe(I,L),L}function N(I,R,M,L={}){var K=Q(R),j=Ko({x:R.x,y:R.y,width:R.width,height:R.height},L);return C(I,K.name,{align:M,box:j,padding:7,style:{fill:qo(R,u,c,L.stroke)}})}function O(I,R,M,L={}){var K=gt(M),j=C(I,R,{box:{height:30,width:K?qt(M,L):hn(M,L)},align:"center-middle",style:{fill:qo(M,u,c,L.stroke)}});K&&vs(j,0,1*qt(M,L),270)}function B(I,R,M={}){var{width:L,height:K}=Ko(R,M);return g(I,L,K,10,{...M,fill:ke(R,s,M.fill),fillOpacity:Yr,stroke:se(R,c,M.stroke)})}function H(I,R,M={}){var L=Q(R),K=ke(R,s,M.fill),j=se(R,c,M.stroke);return L.get("associationDirection")!=="One"&&L.get("associationDirection")!=="Both"||(M.markerEnd=f(I,"association-end",K,j)),L.get("associationDirection")==="Both"&&(M.markerStart=f(I,"association-start",K,j)),M=Ne(M,["markerStart","markerEnd"]),_(I,R.waypoints,{...M,stroke:j,strokeDasharray:"0, 5"})}function q(I,R,M={}){var L=ke(R,s,M.fill),K=se(R,c,M.stroke),j=b(I,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:R.width,containerHeight:R.height,position:{mx:.474,my:.296}}),{fill:L,fillOpacity:Yr,stroke:K});return function(G){var J=G.dataObjectRef;return G.isCollection||J&&J.isCollection}(Q(R))&&b(I,i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:R.width,containerHeight:R.height,position:{mx:.33,my:(R.height-18)/R.height}}),{strokeWidth:2,fill:L,stroke:K}),j}function U(I,R,M={}){return v(I,R.width,R.height,{fillOpacity:Yr,...M,fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke)})}function V(I,R,M={}){return function(L,K,j,G){var J=K/2,Y=j/2,he=[{x:J,y:0},{x:K,y:Y},{x:J,y:j},{x:0,y:Y}].map(function(je){return je.x+","+je.y}).join(" ");G=p(G);var be=ue("polygon",{...G,points:he});return xe(L,be),be}(I,R.width,R.height,{fill:ke(R,s,M.fill),fillOpacity:Yr,stroke:se(R,c,M.stroke)})}function te(I,R,M={}){var L=g(I,hn(R,M),qt(R,M),0,{fill:ke(R,s,M.fill),fillOpacity:M.fillOpacity||Yr,stroke:se(R,c,M.stroke),strokeWidth:1.5}),K=Q(R);return P(K,"bpmn:Lane")&&O(I,K.get("name"),R,M),L}function X(I,R,M={}){var L=B(I,R,M);wt(R)&&ae(L,{strokeDasharray:"0, 5.5",strokeWidth:2.5});var K=Ae(R);return N(I,R,K?"center-top":"center-middle",M),x(I,R,K?void 0:["SubProcessMarker"],M),L}function oe(I,R,M={}){var L=B(I,R,M);return N(I,R,"center-middle",M),x(I,R,void 0,M),L}var ne=this.handlers={"bpmn:AdHocSubProcess":function(I,R,M={}){return X(I,R,M=Ae(R)?Ne(M,["fill","stroke","width","height"]):Ne(M,["fill","stroke"]))},"bpmn:Association":function(I,R,M={}){return H(I,R,M=Ne(M,["fill","stroke"]))},"bpmn:BoundaryEvent":function(I,R,M={}){var{renderIcon:L=!0}=M;M=Ne(M,["fill","stroke"]);var K=Q(R).get("cancelActivity");M={strokeWidth:1.5,fill:ke(R,s,M.fill),fillOpacity:1,stroke:se(R,c,M.stroke)},K||(M.strokeDasharray="6");var j=U(I,R,M);return v(I,R.width,R.height,3,{...M,fill:"none"}),L&&l(R,I,M),j},"bpmn:BusinessRuleTask":function(I,R,M={}){var L=oe(I,R,M=Ne(M,["fill","stroke"]));return ae(b(I,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke),strokeWidth:1}),ae(b(I,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:se(R,c,M.stroke),stroke:se(R,c,M.stroke),strokeWidth:1}),L},"bpmn:CallActivity":function(I,R,M={}){return M=Ne(M,["fill","stroke"]),X(I,R,{strokeWidth:5,...M})},"bpmn:ComplexGateway":function(I,R,M={}){var L=V(I,R,M=Ne(M,["fill","stroke"]));return b(I,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:R.width,containerHeight:R.height,position:{mx:.46,my:.26}}),{fill:se(R,c,M.stroke),stroke:se(R,c,M.stroke),strokeWidth:1}),L},"bpmn:DataInput":function(I,R,M={}){M=Ne(M,["fill","stroke"]);var L=i.getRawPath("DATA_ARROW"),K=q(I,R,M);return b(I,L,{fill:"none",stroke:se(R,c,M.stroke),strokeWidth:1}),K},"bpmn:DataInputAssociation":function(I,R,M={}){return M=Ne(M,["fill","stroke"]),H(I,R,{...M,markerEnd:f(I,"association-end",ke(R,s,M.fill),se(R,c,M.stroke))})},"bpmn:DataObject":function(I,R,M={}){return q(I,R,M=Ne(M,["fill","stroke"]))},"bpmn:DataObjectReference":k("bpmn:DataObject"),"bpmn:DataOutput":function(I,R,M={}){M=Ne(M,["fill","stroke"]);var L=i.getRawPath("DATA_ARROW"),K=q(I,R,M);return b(I,L,{strokeWidth:1,fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke)}),K},"bpmn:DataOutputAssociation":function(I,R,M={}){return M=Ne(M,["fill","stroke"]),H(I,R,{...M,markerEnd:f(I,"association-end",ke(R,s,M.fill),se(R,c,M.stroke))})},"bpmn:DataStoreReference":function(I,R,M={}){return M=Ne(M,["fill","stroke"]),b(I,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:R.width,containerHeight:R.height,position:{mx:0,my:.133}}),{fill:ke(R,s,M.fill),fillOpacity:Yr,stroke:se(R,c,M.stroke),strokeWidth:2})},"bpmn:EndEvent":function(I,R,M={}){var{renderIcon:L=!0}=M;M=Ne(M,["fill","stroke"]);var K=U(I,R,{...M,strokeWidth:4});return L&&l(R,I,M),K},"bpmn:EventBasedGateway":function(I,R,M={}){M=Ne(M,["fill","stroke"]);var L=Q(R),K=V(I,R,M);v(I,R.width,R.height,.2*R.height,{fill:ke(R,"none",M.fill),stroke:se(R,c,M.stroke),strokeWidth:1});var j=L.get("eventGatewayType"),G=!!L.get("instantiate");if(j==="Parallel"){var J=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:R.width,containerHeight:R.height,position:{mx:.474,my:.296}});b(I,J,{fill:"none",stroke:se(R,c,M.stroke),strokeWidth:1})}else j==="Exclusive"&&(G||v(I,R.width,R.height,.26*R.height,{fill:"none",stroke:se(R,c,M.stroke),strokeWidth:1}),function(){var Y=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:R.width,containerHeight:R.height,position:{mx:.36,my:.44}});b(I,Y,{fill:"none",stroke:se(R,c,M.stroke),strokeWidth:2})}());return K},"bpmn:ExclusiveGateway":function(I,R,M={}){var L=V(I,R,M=Ne(M,["fill","stroke"])),K=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:R.width,containerHeight:R.height,position:{mx:.32,my:.3}});return Me(R).get("isMarkerVisible")&&b(I,K,{fill:se(R,c,M.stroke),stroke:se(R,c,M.stroke),strokeWidth:1}),L},"bpmn:Gateway":function(I,R,M={}){return V(I,R,M=Ne(M,["fill","stroke"]))},"bpmn:Group":function(I,R,M={}){return M=Ne(M,["fill","stroke","width","height"]),g(I,R.width,R.height,10,{stroke:se(R,c,M.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:hn(R,M),height:qt(R,M)})},"bpmn:InclusiveGateway":function(I,R,M={}){var L=V(I,R,M=Ne(M,["fill","stroke"]));return v(I,R.width,R.height,.24*R.height,{fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke),strokeWidth:2.5}),L},"bpmn:IntermediateEvent":function(I,R,M={}){var{renderIcon:L=!0}=M;M=Ne(M,["fill","stroke"]);var K=U(I,R,{...M,strokeWidth:1.5});return v(I,R.width,R.height,3,{fill:"none",stroke:se(R,c,M.stroke),strokeWidth:1.5}),L&&l(R,I,M),K},"bpmn:IntermediateCatchEvent":k("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":k("bpmn:IntermediateEvent"),"bpmn:Lane":function(I,R,M={}){return M=Ne(M,["fill","stroke","width","height"]),te(I,R,{...M,fillOpacity:.25})},"bpmn:ManualTask":function(I,R,M={}){var L=oe(I,R,M=Ne(M,["fill","stroke"]));return b(I,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke),strokeWidth:.5}),L},"bpmn:MessageFlow":function(I,R,M={}){M=Ne(M,["fill","stroke"]);var L=Q(R),K=Me(R),j=ke(R,s,M.fill),G=se(R,c,M.stroke),J=_(I,R.waypoints,{markerEnd:f(I,"messageflow-end",j,G),markerStart:f(I,"messageflow-start",j,G),stroke:G,strokeDasharray:"10, 11",strokeWidth:1.5});if(L.get("messageRef")){var Y=J.getPointAtLength(J.getTotalLength()/2),he=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:Y.x,y:Y.y}}),be={strokeWidth:1};K.get("messageVisibleKind")==="initiating"?(be.fill=j,be.stroke=G):(be.fill=G,be.stroke=j);var je=b(I,he,be),De=C(I,L.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:G}}),Mt=je.getBBox(),ie=De.getBBox();vs(De,Y.x-ie.width/2,Y.y+Mt.height/2+10,0)}return J},"bpmn:ParallelGateway":function(I,R,M={}){var L=V(I,R,M=Ne(M,["fill","stroke"]));return b(I,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:R.width,containerHeight:R.height,position:{mx:.46,my:.2}}),{fill:se(R,c,M.stroke),stroke:se(R,c,M.stroke),strokeWidth:1}),L},"bpmn:Participant":function(I,R,M={}){var L=te(I,R,M=Ne(M,["fill","stroke","width","height"])),K=Ae(R),j=gt(R),G=Q(R),J=G.get("name");if(K)E(I,j?[{x:30,y:0},{x:30,y:qt(R,M)}]:[{x:0,y:30},{x:hn(R,M),y:30}],{stroke:se(R,c,M.stroke),strokeWidth:1.5}),O(I,J,R,M);else{var Y=Ko(R,M);j||(Y.height=hn(R,M),Y.width=qt(R,M));var he=C(I,J,{box:Y,align:"center-middle",style:{fill:qo(R,u,c,M.stroke)}});j||vs(he,0,1*qt(R,M),270)}return G.get("participantMultiplicity")&&y("ParticipantMultiplicityMarker",I,R,M),L},"bpmn:ReceiveTask":function(I,R,M={}){M=Ne(M,["fill","stroke"]);var L,K=Q(R),j=oe(I,R,M);return K.get("instantiate")?(v(I,28,28,4.4,{fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke),strokeWidth:1}),L=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):L=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),b(I,L,{fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke),strokeWidth:1}),j},"bpmn:ScriptTask":function(I,R,M={}){var L=oe(I,R,M=Ne(M,["fill","stroke"]));return b(I,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke),strokeWidth:1}),L},"bpmn:SendTask":function(I,R,M={}){var L=oe(I,R,M=Ne(M,["fill","stroke"]));return b(I,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:se(R,c,M.stroke),stroke:ke(R,s,M.fill),strokeWidth:1}),L},"bpmn:SequenceFlow":function(I,R,M={}){M=Ne(M,["fill","stroke"]);var L=ke(R,s,M.fill),K=se(R,c,M.stroke),j=_(I,R.waypoints,{markerEnd:f(I,"sequenceflow-end",L,K),stroke:K}),G=Q(R),{source:J}=R;if(J){var Y=Q(J);G.get("conditionExpression")&&P(Y,"bpmn:Activity")&&ae(j,{markerStart:f(I,"conditional-flow-marker",L,K)}),Y.get("default")&&(P(Y,"bpmn:Gateway")||P(Y,"bpmn:Activity"))&&Y.get("default")===G&&ae(j,{markerStart:f(I,"conditional-default-flow-marker",L,K)})}return j},"bpmn:ServiceTask":function(I,R,M={}){var L=oe(I,R,M=Ne(M,["fill","stroke"]));return v(I,10,10,{fill:ke(R,s,M.fill),stroke:"none",transform:"translate(6, 6)"}),b(I,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke),strokeWidth:1}),v(I,10,10,{fill:ke(R,s,M.fill),stroke:"none",transform:"translate(11, 10)"}),b(I,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke),strokeWidth:1}),L},"bpmn:StartEvent":function(I,R,M={}){var{renderIcon:L=!0}=M;M=Ne(M,["fill","stroke"]),Q(R).get("isInterrupting")||(M={...M,strokeDasharray:"6"});var K=U(I,R,M);return L&&l(R,I,M),K},"bpmn:SubProcess":function(I,R,M={}){return X(I,R,M=Ae(R)?Ne(M,["fill","stroke","width","height"]):Ne(M,["fill","stroke"]))},"bpmn:Task":function(I,R,M={}){return oe(I,R,M=Ne(M,["fill","stroke"]))},"bpmn:TextAnnotation":function(I,R,M={}){M=Ne(M,["fill","stroke","width","height"]);var{width:L,height:K}=Ko(R,M),j=g(I,L,K,0,0,{fill:"none",stroke:"none"});return b(I,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:L,containerHeight:K,position:{mx:0,my:0}}),{stroke:se(R,c,M.stroke)}),C(I,Q(R).get("text")||"",{align:"left-top",box:Ko(R,M),padding:7,style:{fill:qo(R,u,c,M.stroke)}}),j},"bpmn:Transaction":function(I,R,M={}){M=Ae(R)?Ne(M,["fill","stroke","width","height"]):Ne(M,["fill","stroke"]);var L=X(I,R,{strokeWidth:1.5,...M}),K=n.style(["no-fill","no-events"],{stroke:se(R,c,M.stroke),strokeWidth:1.5});return Ae(R)||(M={}),g(I,hn(R,M),qt(R,M),7,3,K),L},"bpmn:UserTask":function(I,R,M={}){var L=oe(I,R,M=Ne(M,["fill","stroke"]));return b(I,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke),strokeWidth:.5}),b(I,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:ke(R,s,M.fill),stroke:se(R,c,M.stroke),strokeWidth:.5}),b(I,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:se(R,c,M.stroke),stroke:se(R,c,M.stroke),strokeWidth:.5}),L},label:function(I,R,M={}){return function(L,K,j={}){var G={width:90,height:30,x:K.width/2+K.x,y:K.height/2+K.y};return C(L,tn(K),{box:G,fitBox:!0,style:z({},o.getExternalStyle(),{fill:qo(K,u,c,j.stroke)})})}(I,R,M)}};this._drawPath=b,this._renderer=S}function Ne(e,t=[]){return t.reduce((n,i)=>(e[i]&&(n[i]=e[i]),n),{})}le(mr,Qn),mr.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],mr.prototype.canRender=function(e){return P(e,"bpmn:BaseElement")},mr.prototype.drawShape=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},mr.prototype.drawConnection=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},mr.prototype.getShapePath=function(e){return P(e,"bpmn:Event")?function(t){var n=t.x+t.width/2,i=t.y+t.height/2,r=t.width/2;return sr([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])}(e):P(e,"bpmn:Activity")?function(t,n){var i=t.x,r=t.y,o=t.width,a=t.height;return sr([["M",i+n,r],["l",o-20,0],["a",n,n,0,0,1,n,n],["l",0,a-20],["a",n,n,0,0,1,-10,n],["l",20-o,0],["a",n,n,0,0,1,-10,-10],["l",0,20-a],["a",n,n,0,0,1,n,-10],["z"]])}(e,10):P(e,"bpmn:Gateway")?function(t){var n=t.width/2,i=t.height/2;return sr([["M",t.x+n,t.y],["l",n,i],["l",-n,i],["l",-n,-i],["z"]])}(e):function(t){var n=t.x,i=t.y,r=t.width;return sr([["M",n,i],["l",r,0],["l",0,t.height],["l",-r,0],["z"]])}(e)};var hE={width:150,height:50};function mE(e,t){var n;t.textContent=e;try{var i,r=e==="";return t.textContent=r?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch{return{width:0,height:0}}}function fE(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=mE(o,n)).width=o?i.width:0,o===" "||o===""||i.width<Math.round(t)||o.length<2)return vE(e,o,r,i);o=yE(o,i.width,t)}}function vE(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}}var af="\xAD";function yE(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(o,a){var s,c=o.split(/(\s|-|\u00AD)/g),u=[],p=0;if(c.length>1)for(;s=c.shift();){if(!(s.length+p<a)){s!=="-"&&s!==af||u.pop();break}u.push(s),p+=s.length}var d=u[u.length-1];return d&&d===af&&(u[u.length-1]="-"),u.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function Ss(e){this._config=z({},{size:hE,padding:0,style:{},align:"center-top"},e||{})}function sf(e){var t=z({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=z({},t,{fontSize:n},e&&e.externalStyle||{}),r=new Ss({style:t});this.getExternalLabelBounds=function(o,a){var s=r.getDimensions(a,{box:{width:90,height:30},style:i});return{x:Math.round(o.x+o.width/2-s.width/2),y:Math.round(o.y),width:Math.ceil(s.width),height:Math.ceil(s.height)}},this.getTextAnnotationBounds=function(o,a){var s=r.getDimensions(a,{box:o,style:t,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(30,Math.round(s.height))}},this.createText=function(o,a){return r.createText(o,a||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}Ss.prototype.createText=function(e,t){return this.layoutText(e,t).element},Ss.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},Ss.prototype.layoutText=function(e,t){var n,i=z({},this._config.size,t.box),r=z({},this._config.style,t.style),o=function(_){var b=_.split("-");return{horizontal:b[0]||"center",vertical:b[1]||"top"}}(t.align||this._config.align),a=function(_){return vt(_)?z({top:0,left:0,right:0,bottom:0},_):{top:_,left:_,right:_,bottom:_}}(t.padding!==void 0?t.padding:this._config.padding),s=t.fitBox||!1,c=function(_){if("fontSize"in _&&"lineHeight"in _)return _.lineHeight*parseInt(_.fontSize,10)}(r),u=e.split(/\u00AD?\r?\n/),p=[],d=i.width-a.left-a.right,m=ue("text");for(ae(m,{x:0,y:0}),ae(m,r),xe((n=void 0,(n=document.getElementById("helper-svg"))||(ae(n=ue("svg"),{id:"helper-svg"}),At(n,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(n)),n),m);u.length;)p.push(fE(u,d,m));o.vertical==="middle"&&(a.top=a.bottom=0);var f=Ht(p,function(_,b,w){return _+(c||b.height)},0)+a.top+a.bottom,v=Ht(p,function(_,b,w){return b.width>_?b.width:_},0),g=a.top;o.vertical==="middle"&&(g+=(i.height-f)/2),g-=(c||p[0].height)/4;var E=ue("text");return ae(E,r),$(p,function(_){var b;switch(g+=c||_.height,o.horizontal){case"left":b=a.left;break;case"right":b=(s?v:d)-a.right-_.width;break;default:b=Math.max(((s?v:d)-_.width)/2+a.left,0)}var w=ue("tspan");ae(w,{x:b,y:g}),w.textContent=_.text,xe(E,w)}),dt(m),{dimensions:{width:v,height:f},element:E}},sf.$inject=["config.textRenderer"];var gE=/\{([^{}]+)\}/g,bE=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;const xE={__init__:["bpmnRenderer"],bpmnRenderer:["type",mr],textRenderer:["type",sf],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/r.height*t.yScaleFactor,s=t.containerWidth/r.width*t.xScaleFactor,c=0;c<r.heightElements.length;c++)o["y"+c]=r.heightElements[c]*a;for(var u=0;u<r.widthElements.length;u++)o["x"+u]=r.widthElements[u]*s}var p,d,m=(p=r.d,d={mx:n,my:i,e:o},String(p).replace(gE,function(f,v){return function(g,E,_){var b=_;return E.replace(bE,function(w,S,k,l,h){S=S||l,b&&(S in b&&(b=b[S]),typeof b=="function"&&h&&(b=b()))}),b=(b==null||b==_?g:b)+""}(f,v,d)}));return m}}]},Cs={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(n,i){return t[i]||"{"+i+"}"})}]};function ks(e,t,n){return z({id:e.id,type:e.$type,businessObject:e,di:t},n)}function _E(e,t,n){var i=e.waypoint;return!i||i.length<2?[ge(t),ge(n)]:i.map(function(r){return{x:r.x,y:r.y}})}function lf(e,t,n){return new Error(`element ${Pt(t)} referenced by ${Pt(e)}#${n} not yet drawn`)}function ri(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._textRenderer=r}ri.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],ri.prototype.add=function(e,t,n){var i,r,o;if(P(t,"bpmndi:BPMNPlane")){var a=P(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(ks(e,t,a)),this._canvas.addRootElement(i)}else if(P(t,"bpmndi:BPMNShape")){var s=!Ae(e,t),c=function(m){return P(m,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var u=t.bounds;i=this._elementFactory.createShape(ks(e,t,{collapsed:s,hidden:r,x:Math.round(u.x),y:Math.round(u.y),width:Math.round(u.width),height:Math.round(u.height),isFrame:c})),P(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),P(e,"bpmn:Lane")&&(o=0),P(e,"bpmn:DataStoreReference")&&(function(m,f){var v=f.x,g=f.y;return v>=m.x&&v<=m.x+m.width&&g>=m.y&&g<=m.y+m.height}(n,ge(u))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!P(t,"bpmndi:BPMNEdge"))throw new Error(`unknown di ${Pt(t)} for element ${Pt(e)}`);var p=this._getSource(e),d=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(ks(e,t,{hidden:r,source:p,target:d,waypoints:_E(t,p,d)})),P(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return hr(e)&&tn(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},ri.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${Pt(e)}#attachedToRef`);var i=this._elementRegistry.get(n.id),r=i&&i.attachers;if(!i)throw lf(e,n,"attachedToRef");t.host=i,r||(i.attachers=r=[]),r.indexOf(t)===-1&&r.push(t)},ri.prototype.addLabel=function(e,t,n){var i,r,o;return i=function(a,s){var c,u,p,d=a.label;return d&&d.bounds?(p=d.bounds,u={width:Math.max(Wo.width,p.width),height:p.height},c={x:p.x+p.width/2,y:p.y+p.height/2}):(c=gu(s),u=Wo),z({x:c.x-u.width/2,y:c.y-u.height/2},u)}(t,n),(r=tn(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(ks(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!tn(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)},ri.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type;if(i=e[t+"Ref"],t==="source"&&r==="bpmn:DataInputAssociation"&&(i=i&&i[0]),(t==="source"&&r==="bpmn:DataOutputAssociation"||t==="target"&&r==="bpmn:DataInputAssociation")&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?lf(e,i,t+"Ref"):new Error(`${Pt(e)}#${t} Ref not specified`)},ri.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},ri.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},ri.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};const EE={__depends__:[xE,{__depends__:[Cs],bpmnImporter:["type",ri]}]};function Xo(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Xo.prototype.next=function(){return this._prefix+ ++this._counter};var wE=new Xo("ov");function _t(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=wE,this._overlayDefaults=z({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),At(o=He('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function cf(e,t,n){At(e,{left:t+"px",top:n+"px"})}function As(e,t){e.style.display=t===!1?"none":""}function uf(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}_t.$inject=["config.overlays","eventBus","canvas","elementRegistry"],_t.prototype.get=function(e){if(Ut(e)&&(e={id:e}),Ut(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?Ce(t.overlays,Tn({type:e.type})):t.overlays.slice():[]}return e.type?Ce(this._overlays,Tn({type:e.type})):e.id?this._overlays[e.id]:null},_t.prototype.add=function(e,t,n){if(vt(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=z({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},_t.prototype.remove=function(e){var t=this.get(e)||[];Ee(t)||(t=[t]);var n=this;$(t,function(i){var r=n._getOverlayContainer(i.element,!0);if(i&&(Fn(i.html),Fn(i.htmlContainer),delete i.htmlContainer,delete i.element,delete n._overlays[i.id]),r){var o=r.overlays.indexOf(i);o!==-1&&r.overlays.splice(o,1)}})},_t.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"},_t.prototype.show=function(){As(this._overlayRoot)},_t.prototype.hide=function(){As(this._overlayRoot,!1)},_t.prototype.clear=function(){this._overlays={},this._overlayContainers=[],es(this._overlayRoot)},_t.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=yt(t);i=o.x,r=o.y}cf(n,i,r),It(e.html,"data-container-id",t.id)},_t.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,a=i.left,s=i.top;i.right!==void 0&&(t=o.waypoints?yt(o).width:o.width,a=-1*i.right+t),i.bottom!==void 0&&(n=o.waypoints?yt(o).height:o.height,s=-1*i.bottom+n),cf(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},_t.prototype._createOverlayContainer=function(e){var t=He('<div class="djs-overlays" />');At(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},_t.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";uf(this._overlayRoot,n)},_t.prototype._getOverlayContainer=function(e,t){var n=Be(this._overlayContainers,function(i){return i.element===e});return n||t?n:this._createOverlayContainer(e)},_t.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)),Ut(o)&&(o=He(o)),n=this._getOverlayContainer(r),At(t=He('<div class="djs-overlay" data-overlay-id="'+i+'">'),{position:"absolute"}),t.appendChild(o),e.type&&Ke(t).add("djs-overlay-"+e.type),As(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())},_t.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=!0;(i!==this._canvas.getRootElement()||n&&(xt(r)&&r>t.scale||xt(o)&&o<t.scale))&&(s=!1),As(a,s),this._updateOverlayScale(e,t)},_t.prototype._updateOverlayScale=function(e,t){var n,i,r,o=e.scale,a=e.htmlContainer,s="";o!==!0&&(o===!1?(n=1,i=1):(n=o.min,i=o.max),xt(n)&&t.scale<n&&(r=(1/t.scale||1)*n),xt(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),xt(r)&&(s="scale("+r+","+r+")"),uf(a,s)},_t.prototype._updateOverlaysVisibilty=function(e){var t=this;$(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},_t.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",function(n){t.hide()}),e.on("canvas.viewbox.changed",function(n){var i;i=n.viewbox,t._updateRoot(i),t._updateOverlaysVisibilty(i),t.show()}),e.on(["shape.remove","connection.remove"],function(n){var i=n.element;$(t.get({element:i}),function(a){t.remove(a.id)});var r=t._getOverlayContainer(i);if(r){Fn(r.html);var o=t._overlayContainers.indexOf(r);o!==-1&&t._overlayContainers.splice(o,1)}}),e.on("element.changed",500,function(n){var i=n.element,r=t._getOverlayContainer(i,!0);r&&($(r.overlays,function(o){t._updateOverlay(o)}),t._updateOverlayContainer(r))}),e.on("element.marker.update",function(n){var i=t._getOverlayContainer(n.element,!0);i&&Ke(i.html)[n.add?"add":"remove"](n.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};const Ts={__init__:["overlays"],overlays:["type",_t]};function pf(e,t,n,i){e.on("element.changed",function(r){var o=r.element;(o.parent||o===t.getRootElement())&&(r.gfx=n.getGraphics(o)),r.gfx&&e.fire(om(o)+".changed",r)}),e.on("elements.changed",function(r){var o=r.elements;o.forEach(function(a){e.fire("element.changed",{element:a})}),i.updateContainments(o)}),e.on("shape.changed",function(r){i.update("shape",r.element,r.gfx)}),e.on("connection.changed",function(r){i.update("connection",r.element,r.gfx)})}pf.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const xu={__init__:["changeSupport"],changeSupport:["type",pf]};function Z(e){this._eventBus=e}function oi(e){return function(t,n,i,r,o){(rt(t)||ye(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function _u(e,t){t.invoke(Z,this),this.executed(function(n){var i=n.context;i.rootElement?e.setRootElement(i.rootElement):i.rootElement=e.getRootElement()}),this.revert(function(n){var i=n.context;i.rootElement&&e.setRootElement(i.rootElement)})}Z.$inject=["eventBus"],Z.prototype.on=function(e,t,n,i,r,o){if((rt(t)||ye(t))&&(o=r,r=i,i=n,n=t,t=null),rt(n)&&(o=r,r=i,i=n,n=1e3),vt(r)&&(o=r,r=!1),!rt(i))throw new Error("handlerFn must be a function");Ee(e)||(e=[e]);var a=this._eventBus;$(e,function(s){var c=["commandStack",s,t].filter(function(u){return u}).join(".");a.on(c,n,r?function(u,p){return function(d){return u.call(p||null,d.context,d.command,d)}}(i,o):i,o)})},Z.prototype.canExecute=oi("canExecute"),Z.prototype.preExecute=oi("preExecute"),Z.prototype.preExecuted=oi("preExecuted"),Z.prototype.execute=oi("execute"),Z.prototype.executed=oi("executed"),Z.prototype.postExecute=oi("postExecute"),Z.prototype.postExecuted=oi("postExecuted"),Z.prototype.revert=oi("revert"),Z.prototype.reverted=oi("reverted"),le(_u,Z),_u.$inject=["canvas","injector"];const SE={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",_u]};function Yo(e){return CSS.escape(e)}var CE={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Eu(e){return(e=""+e)&&e.replace(/[&<>"']/g,function(t){return CE[t]})}var df="_plane";function hf(e){return e.id.replace(new RegExp(df+"$"),"")}function ai(e){var t=e.id;return P(e,"bpmn:SubProcess")?mf(t):t}function fr(e){return mf(e)}function Ps(e){return P(Me(e),"bpmndi:BPMNPlane")}function mf(e){return e+df}function ff(e,t,n){var i=He('<ul class="bjs-breadcrumbs"></ul>'),r=n.getContainer(),o=Ke(r);r.appendChild(i);var a=[];function s(c){c&&(a=function(d){for(var m=[],f=Q(d);f;f=f.$parent)(P(f,"bpmn:SubProcess")||P(f,"bpmn:Process"))&&m.push(f);return m.reverse()}(c));var u=a.flatMap(function(d){var m=n.findRoot(ai(d))||n.findRoot(d.id);if(!m&&P(d,"bpmn:Process")){var f=t.find(function(E){var _=Q(E);return _&&_.get("processRef")===d});m=f&&n.findRoot(f.id)}if(!m)return[];var v=Eu(d.name||d.id),g=He('<li><span class="bjs-crumb"><a title="'+v+'">'+v+"</a></span></li>");return g.addEventListener("click",function(){n.setRootElement(m)}),g});i.innerHTML="";var p=u.length>1;o.toggle("bjs-breadcrumbs-shown",p),u.forEach(function(d){i.appendChild(d)})}e.on("element.changed",function(c){var u=Q(c.element);Be(a,function(p){return p===u})&&s()}),e.on("root.set",function(c){s(c.element)})}function vf(e,t){var n=null,i=new kE;e.on("root.set",function(r){var o=r.element,a=t.viewbox(),s=i.get(o);if(i.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=o,P(o,"bpmn:SubProcess")||s){s=s||{x:0,y:0,zoom:1};var c=(a.x-s.x)*a.scale,u=(a.y-s.y)*a.scale;c===0&&u===0||t.scroll({dx:c,dy:u}),s.zoom!==a.scale&&t.zoom(s.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){i.clear(),n=null})}function kE(){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}t!==-1&&this._entries.splice(t,1)}}ff.$inject=["eventBus","elementRegistry","canvas"],vf.$inject=["eventBus","canvas"];function vr(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(i,r){n._handleImport(r.definitions)})}function yf(e){return P(e,"bpmndi:BPMNDiagram")?e:yf(e.$parent)}vr.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(n){n.plane&&n.plane.bpmnElement&&(t._processToDiagramMap[n.plane.bpmnElement.id]=n)}),e.diagrams.filter(n=>n.plane).flatMap(n=>t._createNewDiagrams(n.plane)).forEach(function(n){t._movePlaneElementsToOrigin(n.plane)})}},vr.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach(function(o){var a=o.bpmnElement;if(a){var s=a.$parent;P(a,"bpmn:SubProcess")&&!o.isExpanded&&n.push(a),function(c,u){var p=c.$parent;return!(!P(p,"bpmn:SubProcess")||p===u.bpmnElement)&&!Se(c,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"])}(a,e)&&i.push({diElement:o,parent:s})}});var r=[];return n.forEach(function(o){if(!t._processToDiagramMap[o.id]){var a=t._createDiagram(o);t._processToDiagramMap[o.id]=a,r.push(a)}}),i.forEach(function(o){for(var a=o.diElement,s=o.parent;s&&n.indexOf(s)===-1;)s=s.$parent;if(s){var c=t._processToDiagramMap[s.id];t._moveToDiPlane(a,c.plane)}}),r},vr.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=function(o){var a={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return o.planeElement.forEach(function(s){if(s.bounds){var c=de(s.bounds);a.top=Math.min(c.top,a.top),a.left=Math.min(c.left,a.left)}}),hs(a)}(e),i=n.x-180,r=n.y-160;t.forEach(function(o){o.waypoint?o.waypoint.forEach(function(a){a.x=a.x-i,a.y=a.y-r}):o.bounds&&(o.bounds.x=o.bounds.x-i,o.bounds.y=o.bounds.y-r)})},vr.prototype._moveToDiPlane=function(e,t){var n=yf(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},vr.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},vr.$inject=["eventBus","moddle"];var Rs=250;function Ni(e,t,n,i,r){Z.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",Rs,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.reverted("shape.toggleCollapse",Rs,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.executed(["shape.create","shape.move","shape.delete"],Rs,function(a){var s=a.oldParent,c=a.newParent||a.parent,u=a.shape;o._canDrillDown(u)&&o._addOverlay(u),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(u)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Rs,function(a){var s=a.oldParent,c=a.newParent||a.parent,u=a.shape;o._canDrillDown(u)&&o._addOverlay(u),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(u)},!0),t.on("import.render.complete",function(){n.filter(function(a){return o._canDrillDown(a)}).map(function(a){o._addOverlay(a)})})}le(Ni,Z),Ni.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Ni.prototype._canDrillDown=function(e){var t=this._canvas;return P(e,"bpmn:SubProcess")&&t.findRoot(ai(e))},Ni.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=Q(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;Ke(i.html).toggle("bjs-drilldown-empty",!r)}},Ni.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,i=Q(e);n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var r=He('<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(ai(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:r}),this._updateOverlayVisibility(e)},Ni.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Ni.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];const AE={__depends__:[Ts,xu,SE],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",ff],drilldownCentering:["type",vf],drilldownOverlayBehavior:["type",Ni],subprocessCompatibility:["type",vr]};function yr(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),i=this;function r(o){var a=ue("rect");return ae(a,z({x:0,y:0,rx:4,width:100,height:100},n)),a}e.on(["shape.added","shape.changed"],500,function(o){var a=o.element,s=o.gfx,c=Ve(".djs-outline",s);c||xe(s,c=i.getOutline(a)||r()),i.updateShapeOutline(c,a)}),e.on(["connection.added","connection.changed"],function(o){var a=o.element,s=o.gfx,c=Ve(".djs-outline",s);c||xe(s,c=r()),i.updateConnectionOutline(c,a)})}yr.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&$(i,function(r){n=n||r.updateOutline(t,e)}),n||ae(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},yr.prototype.updateConnectionOutline=function(e,t){var n=yt(t);ae(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},yr.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})},yr.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},yr.prototype.getOutline=function(e){var t;return $(this._getProviders(),function(n){rt(n.getOutline)&&(t=t||n.getOutline(e))}),t},yr.$inject=["eventBus","styles","elementRegistry"];const wu={__init__:["outline"],outline:["type",yr]},TE={width:36,height:50},PE={width:50,height:50};function gf(e,t,n){return ue("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}function Ms(e,t){this._styles=t,e.registerProvider(this)}function bf(e,t){var n;return t==="bpmn:DataObjectReference"?n=TE:t==="bpmn:DataStoreReference"&&(n=PE),e.width===n.width&&e.height===n.height}Ms.$inject=["outline","styles"],Ms.prototype.getOutline=function(e){const t=this._styles.cls("djs-outline",["no-fill"]);var n;if(!Re(e))return P(e,"bpmn:Gateway")?(z((n=ue("rect")).style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),ae(n,z({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):Se(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group","bpmn:CallActivity"])?ae(n=ue("rect"),z({x:-5,y:-5,rx:14,width:e.width+10,height:e.height+10},t)):P(e,"bpmn:EndEvent")?ae(n=ue("circle"),z({cx:e.width/2,cy:e.height/2,r:e.width/2+5+1},t)):P(e,"bpmn:Event")?ae(n=ue("circle"),z({cx:e.width/2,cy:e.height/2,r:e.width/2+5},t)):P(e,"bpmn:DataObjectReference")&&bf(e,"bpmn:DataObjectReference")?n=gf("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},t):P(e,"bpmn:DataStoreReference")&&bf(e,"bpmn:DataStoreReference")&&(n=gf("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},t)),n},Ms.prototype.updateOutline=function(e,t){if(!Re(e))return Se(e,["bpmn:SubProcess","bpmn:Group"])?(ae(t,{width:e.width+10,height:e.height+10}),!0):!!Se(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};const RE={__depends__:[wu],__init__:["outlineProvider"],outlineProvider:["type",Ms]};function xf(e){e&&typeof e.stopPropagation=="function"&&e.stopPropagation()}function Jr(e){return e.originalEvent||e.srcEvent}function Su(e){xf(e),xf(Jr(e))}function gr(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 _f(){return/mac/i.test(navigator.platform)}function Ef(e,t){return(Jr(e)||e).button===t}function Ii(e){return Ef(e,0)}function Jo(e){var t=Jr(e)||e;return!!Ii(e)&&(_f()?t.metaKey:t.ctrlKey)}function Ns(e){var t=Jr(e)||e;return Ii(e)&&t.shiftKey}function ME(e){return!0}function Is(e){return Ii(e)||function(t){return Ef(t,1)}(e)}function wf(e,t,n){var i=this;function r(_,b,w){var S,k;(function(l,h){return!(c[l]||Ii)(h)})(_,b)||(w?k=t.getGraphics(w):(S=b.delegateTarget||b.target)&&(k=S,w=t.get(k)),k&&w&&e.fire(_,{element:w,gfx:k,originalEvent:b})===!1&&(b.stopPropagation(),b.preventDefault()))}var o={};function a(_){return o[_]}var s={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},c={"element.contextmenu":ME,"element.mousedown":Is,"element.mouseup":Is,"element.click":Is,"element.dblclick":Is};function u(_,b,w,S){var k=o[w]=function(l){r(w,l)};S&&(c[w]=S),k.$delegate=un(_,"svg, .djs-element",b,k)}function p(_,b,w){var S=a(w);S&&Hh(_,b,S.$delegate)}e.on("canvas.destroy",function(_){(function(b){$(s,function(w,S){p(b,S,w)})})(_.svg)}),e.on("canvas.init",function(_){(function(b){$(s,function(w,S){u(b,S,w)})})(_.svg)}),e.on(["shape.added","connection.added"],function(_){var b=_.element,w=_.gfx;e.fire("interactionEvents.createHit",{element:b,gfx:w})}),e.on(["shape.changed","connection.changed"],500,function(_){var b=_.element,w=_.gfx;e.fire("interactionEvents.updateHit",{element:b,gfx:w})}),e.on("interactionEvents.createHit",500,function(_){var b=_.element,w=_.gfx;i.createDefaultHit(b,w)}),e.on("interactionEvents.updateHit",function(_){var b=_.element,w=_.gfx;i.updateDefaultHit(b,w)});var d=v("djs-hit djs-hit-stroke"),m=v("djs-hit djs-hit-click-stroke"),f={all:v("djs-hit djs-hit-all"),"click-stroke":m,stroke:d,"no-move":v("djs-hit djs-hit-no-move")};function v(_,b){return b=z({stroke:"white",strokeWidth:15},b||{}),n.cls(_,["no-fill","no-border"],b)}function g(_,b){var w=f[b];if(!w)throw new Error("invalid hit type <"+b+">");return ae(_,w),_}function E(_,b){xe(_,b)}this.removeHits=function(_){$(Wc(".djs-hit",_),dt)},this.createDefaultHit=function(_,b){var w,S=_.waypoints,k=_.isFrame;return S?this.createWaypointsHit(b,S):(w=k?"stroke":"all",this.createBoxHit(b,w,{width:_.width,height:_.height}))},this.createWaypointsHit=function(_,b){var w=ss(b);return g(w,"stroke"),E(_,w),w},this.createBoxHit=function(_,b,w){w=z({x:0,y:0},w);var S=ue("rect");return g(S,b),ae(S,w),E(_,S),S},this.updateDefaultHit=function(_,b){var w=Ve(".djs-hit",b);if(w)return _.waypoints?nm(w,_.waypoints):ae(w,{width:_.width,height:_.height}),w},this.fire=r,this.triggerMouseEvent=function(_,b,w){var S=s[_];if(!S)throw new Error("unmapped DOM event name <"+_+">");return r(S,b,w)},this.mouseHandler=a,this.registerEvent=u,this.unregisterEvent=p}wf.$inject=["eventBus","elementRegistry","styles"];const Bs={__init__:["interactionEvents"],interactionEvents:["type",wf]};function Zr(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(i){var r=i.element;n.deselect(r)}),e.on(["diagram.clear","root.set"],function(i){n.select(null)})}Zr.$inject=["eventBus","canvas"],Zr.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},Zr.prototype.get=function(){return this._selectedElements},Zr.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1},Zr.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();Ee(e)||(e=e?[e]:[]);var r=this._canvas,o=r.getRootElement();e=e.filter(function(a){var s=r.findRoot(a);return o===s}),t?$(e,function(a){n.indexOf(a)===-1&&n.push(a)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Sf="hover",Cf="selected";function Cu(e,t,n){this._canvas=e;var i=this;function r(a,s){e.addMarker(a,s)}function o(a,s){e.removeMarker(a,s)}this._multiSelectionBox=null,t.on("element.hover",function(a){r(a.element,Sf)}),t.on("element.out",function(a){o(a.element,Sf)}),t.on("selection.changed",function(a){var s=a.oldSelection,c=a.newSelection;$(s,function(u){c.indexOf(u)===-1&&function(p){o(p,Cf)}(u)}),$(c,function(u){s.indexOf(u)===-1&&function(p){r(p,Cf)}(u)}),i._updateSelectionOutline(c)}),t.on("element.changed",function(a){n.isSelected(a.element)&&i._updateSelectionOutline(n.get())})}function kf(e,t,n,i){e.on("create.end",500,function(r){var o=r.context,a=o.canExecute,s=o.elements,c=(o.hints||{}).autoSelect;if(a){if(c===!1)return;Ee(c)?t.select(c):t.select(s.filter(NE))}}),e.on("connect.end",500,function(r){var o=r.context.connection;o&&t.select(o)}),e.on("shape.move.end",500,function(r){var o=r.previousSelection||[],a=i.get(r.context.shape.id);Be(o,function(s){return a.id===s.id})||t.select(a)}),e.on("element.click",function(r){if(Ii(r)){var o=r.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),s=t.get().length>1,c=Ns(r);if(a&&s)return c?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,c)}})}function NE(e){return!e.hidden}Cu.$inject=["canvas","eventBus","selection"],Cu.prototype._updateSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");rs(t);var n=e.length>1;if(Pe(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var i=function(o){return{x:o.x-6,y:o.y-6,width:o.width+12,height:o.height+12}}(yt(e)),r=ue("rect");ae(r,z({rx:3},i)),Pe(r).add("djs-selection-outline"),xe(t,r)}},kf.$inject=["eventBus","selection","canvas","elementRegistry"];const Gn={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Bs,wu],selection:["type",Zr],selectionVisuals:["type",Cu],selectionBehavior:["type",kf]};function si(e){Ye.call(this,e)}le(si,Ye),si.prototype._modules=[EE,AE,RE,Ts,Gn,Cs],si.prototype._moddleExtensions={};var IE=["c","C"],BE=["v","V"],DE=["y","Y"],Af=["z","Z"];function nn(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function bt(e,t){return(e=Ee(e)?e:[e]).indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}function ku(e){return e.shiftKey}var Ds="keyboard.keydown",Tf="input-handle-modified-keys";function St(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),t.on("diagram.init",function(){n._fire("init")}),t.on("attach",function(){e&&e.bindTo&&n.bind(e.bindTo)}),t.on("detach",function(){n.unbind()})}function Qr(e,t){var n=this;e.on("editorActions.init",500,function(i){var r=i.editorActions;n.registerBindings(t,r)})}St.$inject=["config.keyboard","eventBus"],St.prototype._keydownHandler=function(e){this._keyHandler(e,Ds)},St.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},St.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Ds,n)&&e.preventDefault()}},St.prototype._isEventIgnored=function(e){return!!e.defaultPrevented||((t=e.target)&&(is(t,"input, textarea")||t.contentEditable==="true")||function(n){return n&&is(n,"button, input[type=submit], input[type=button], a[href], [aria-role=button]")}(e.target)&&bt([" ","Enter"],e))&&this._isModifiedKeyIgnored(e);var t},St.prototype._isModifiedKeyIgnored=function(e){return!nn(e)||this._getAllowedModifiers(e.target).indexOf(e.key)===-1},St.prototype._getAllowedModifiers=function(e){var t=Zn(e,"["+Tf+"]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(Tf).split(",")},St.prototype.bind=function(e){this.unbind(),this._node=e,ve.bind(e,"keydown",this._keydownHandler),ve.bind(e,"keyup",this._keyupHandler),this._fire("bind")},St.prototype.getBinding=function(){return this._node},St.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),ve.unbind(e,"keydown",this._keydownHandler),ve.unbind(e,"keyup",this._keyupHandler)),this._node=null},St.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},St.prototype.addListener=function(e,t,n){rt(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Ds,e,t)},St.prototype.removeListener=function(e,t){this._eventBus.off(t||Ds,e)},St.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},St.prototype.isCmd=nn,St.prototype.isShift=ku,St.prototype.isKey=bt,Qr.$inject=["eventBus","keyboard"],Qr.prototype.registerBindings=function(e,t){function n(i,r){t.isRegistered(i)&&e.addListener(r)}n("undo",function(i){if(function(r){return nn(r)&&!ku(r)&&bt(Af,r)}(i.keyEvent))return t.trigger("undo"),!0}),n("redo",function(i){if(function(r){return nn(r)&&(bt(DE,r)||bt(Af,r)&&ku(r))}(i.keyEvent))return t.trigger("redo"),!0}),n("copy",function(i){if(function(r){return nn(r)&&bt(IE,r)}(i.keyEvent))return t.trigger("copy"),!0}),n("paste",function(i){if(function(r){return nn(r)&&bt(BE,r)}(i.keyEvent))return t.trigger("paste"),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(bt(["+","Add","="],r)&&nn(r))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(bt(["-","Subtract"],r)&&nn(r))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(i){var r=i.keyEvent;if(bt("0",r)&&nn(r))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(i){if(bt(["Backspace","Delete","Del"],i.keyEvent))return t.trigger("removeSelection"),!0})};const Au={__init__:["keyboard","keyboardBindings"],keyboard:["type",St],keyboardBindings:["type",Qr]};var OE={moveSpeed:50,moveSpeedAccelerated:200};function Pf(e,t,n){var i=this;this._config=z({},OE,e||{}),t.addListener(function(r){var o=r.keyEvent,a=i._config;if(t.isCmd(o)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],o)){var s,c=t.isShift(o)?a.moveSpeedAccelerated:a.moveSpeed;switch(o.key){case"ArrowLeft":case"Left":s="left";break;case"ArrowUp":case"Up":s="up";break;case"ArrowRight":case"Right":s="right";break;case"ArrowDown":case"Down":s="down"}return i.moveCanvas({speed:c,direction:s}),!0}}),this.moveCanvas=function(r){var o=0,a=0,s=r.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(r.direction){case"left":o=s;break;case"up":a=s;break;case"right":o=-s;break;case"down":a=-s}n.scroll({dx:o,dy:a})}}Pf.$inject=["config.keyboardMove","keyboard","canvas"];const Rf={__depends__:[Au],__init__:["keyboardMove"],keyboardMove:["type",Pf]};var LE=/^djs-cursor-.*$/;function Os(e){var t=Ke(document.body);t.removeMatching(LE),e&&t.add("djs-cursor-"+e)}function Mf(){Os(null)}function Nf(e,t){function n(){return!1}return t=t||"element.click",e.once(t,5e3,n),function(){e.off(t,n)}}function Zo(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Rn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function If(e,t){var n;function i(o){var a,s=n.start,c=n.button,u=gr(o),p=Rn(u,s);!n.dragging&&(a=p,Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2))>15)&&(n.dragging=!0,c===0&&Nf(e),Os("grab")),n.dragging&&(p=Rn(u,n.last||n.start),t.scroll({dx:p.x,dy:p.y}),n.last=u),o.preventDefault()}function r(o){ve.unbind(document,"mousemove",i),ve.unbind(document,"mouseup",r),n=null,Mf()}e.on("element.mousedown",500,function(o){return function(a){if(!Zn(a.target,".djs-draggable")){var s=a.button;if(!(s>=2||a.ctrlKey||a.shiftKey||a.altKey))return n={button:s,start:gr(a)},ve.bind(document,"mousemove",i),ve.bind(document,"mouseup",r),!0}}(o.originalEvent)}),this.isActive=function(){return!!n}}If.$inject=["eventBus","canvas"];const Bf={__init__:["moveCanvas"],moveCanvas:["type",If]};function Tu(e){return Math.log(e)/Math.log(10)}function Df(e,t){var n=Tu(e.min),i=Tu(e.max);return(Math.abs(n)+Math.abs(i))/t}var jE=Math.sign||function(e){return e>=0?1:-1},Pu={min:.2,max:4};function Wn(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=jt(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.init",function(r){i._init(e.enabled!==!1)})}Wn.$inject=["config.zoomScroll","eventBus","canvas"],Wn.prototype.scroll=function(e){this._canvas.scroll(e)},Wn.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Wn.prototype.zoom=function(e,t){var n=Df(Pu,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},Wn.prototype._handleWheel=function(e){if(!Zn(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey||_f()&&e.metaKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?e.deltaMode===0?.02:.32:e.deltaMode===0?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))*jE(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)}},Wn.prototype.stepZoom=function(e,t){var n=Df(Pu,10);this._zoom(e,t,n)},Wn.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=Tu(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s,c,u=Math.pow(10,a);i.zoom((s=Pu,c=u,Math.max(s.min,Math.min(s.max,c))),t)},Wn.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return e===void 0&&(e=!i),i!==e&&ve[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Wn.prototype._init=function(e){this.toggle(e)};const Of={__init__:["zoomScroll"],zoomScroll:["type",Wn]};function Qo(e){si.call(this,e)}function Ru(e){return e&&e[e.length-1]}function Lf(e){return e.y}function jf(e){return e.x}le(Qo,si),Qo.prototype._navigationModules=[Rf,Bf,Of],Qo.prototype._modules=[].concat(si.prototype._modules,Qo.prototype._navigationModules);var VE={left:jf,center:jf,right:function(e){return e.x+e.width},top:Lf,middle:Lf,bottom:function(e){return e.y+e.height}};function eo(e,t){this._modeling=e,this._rules=t}eo.$inject=["modeling","rules"],eo.prototype._getOrientationDetails=function(e){var t="x",n="width";return["top","bottom","middle"].indexOf(e)!==-1&&(t="y",n="height"),{axis:t,dimension:n}},eo.prototype._isType=function(e,t){return t.indexOf(e)!==-1},eo.prototype._alignmentPosition=function(e,t){var n,i,r,o=this._getOrientationDetails(e),a=o.axis,s=o.dimension,c={},u={},p=!1;if(this._isType(e,["left","top"]))c[e]=t[0][a];else if(this._isType(e,["right","bottom"]))r=Ru(t),c[e]=r[a]+r[s];else if(this._isType(e,["center","middle"])){if($(t,function(d){var m=d[a]+Math.round(d[s]/2);u[m]?u[m].elements.push(d):u[m]={elements:[d],center:m}}),n=$n(u,function(d){return d.elements.length>1&&(p=!0),d.elements.length}),p)return c[e]=Ru(n).center,c;i=t[0],r=Ru(t=$n(t,function(d){return d[a]+d[s]})),c[e]=function(d,m){return Math.round((d[a]+m[a]+m[s])/2)}(i,r)}return c},eo.prototype.trigger=function(e,t){var n,i=this._modeling,r=Ce(e,function(s){return!(s.waypoints||s.host||s.labelTarget)});if(Ee(n=this._rules.allowed("elements.align",{elements:r}))&&(r=n),!(r.length<2)&&n){var o=$n(r,VE[t]),a=this._alignmentPosition(t,o);i.alignElements(o,a)}};const $E={__init__:["alignElements"],alignElements:["type",eo]},FE=new Xo;function to(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(t=>{this.cancel(t)})})}to.$inject=["eventBus"],to.prototype.schedule=function(e,t=FE.next()){this.cancel(t);const n=this._schedule(e,t);return this._scheduled[t]=n,n.promise},to.prototype._schedule=function(e,t){const{promise:n,resolve:i,reject:r}=function(){let a,s;return{promise:new Promise((c,u)=>{a=c,s=u}),resolve:a,reject:s}}();return{executionId:requestAnimationFrame(()=>{try{i(e())}catch(a){r(a)}}),promise:n}},to.prototype.cancel=function(e){const t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)},to.prototype._cancel=function(e){cancelAnimationFrame(e.executionId)};const zE={scheduler:["type",to]};var Ls=".entry";function st(e,t,n,i){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=i,this._current=null,this._init()}st.$inject=["canvas","elementRegistry","eventBus","scheduler"],st.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,i=n.length?n.length===1?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=Ee(r)?r:[r];if(o.filter(function(s){return n.includes(s)}).length){e.close();var a=o.filter(function(s){return e._elementRegistry.get(s.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;(Ee(i.target)?i.target:[i.target]).includes(n)&&e._updateVisibility()}}),this._container=this._createContainer()},st.prototype._createContainer=function(){var e=He('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},st.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})},st.prototype.getEntries=function(e){var t=this._getProviders(),n=Ee(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return $(t,function(r){if(rt(r[n])){var o=r[n](e);rt(o)?i=o(i):$(o,function(a,s){i[s]=a})}}),i},st.prototype.trigger=function(e,t,n){var i,r,o=this,a=t.delegateTarget||t.target;return a?(i=It(a,"data-action"),r=t.originalEvent||t,e!=="mouseover"?e==="mouseout"?(clearTimeout(this._timeout),void(this._mouseout&&(this._mouseout(),this._mouseout=null))):this.triggerEntry(i,e,r,n):void(this._timeout=setTimeout(function(){o._mouseout=o.triggerEntry(i,"hover",r,n)},300))):t.preventDefault()},st.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(this._eventBus.fire("contextPad.trigger",{entry:o,event:n})!==!1){if(rt(a)){if(t==="click")return a(n,r,i)}else if(a[t])return a[t](n,r,i);n.preventDefault()}}}},st.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},st.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},st.prototype._updateAndOpen=function(e){var t,n=this.getEntries(e),i=this._createHtml(e);$(n,function(r,o){var a,s=r.group||"default",c=He(r.html||'<div class="entry" draggable="true"></div>');It(c,"data-action",o),(a=Ve("[data-group="+Yo(s)+"]",i))||(It(a=He('<div class="group"></div>'),"data-group",s),i.appendChild(a)),a.appendChild(c),r.className&&function(u,p){var d=Ke(u);(p=Ee(p)?p:p.split(/\s+/g)).forEach(function(m){d.add(m)})}(c,r.className),r.title&&It(c,"title",r.title),r.imageUrl&&(It(t=He("<img>"),"src",r.imageUrl),t.style.width="100%",t.style.height="100%",c.appendChild(t))}),Ke(i).add("open"),this._current={entries:n,html:i,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})},st.prototype._createHtml=function(e){var t=this,n=He('<div class="djs-context-pad"></div>');return un(n,Ls,"click",function(i){t.trigger("click",i)}),un(n,Ls,"dragstart",function(i){t.trigger("dragstart",i)}),un(n,Ls,"mouseover",function(i){t.trigger("mouseover",i)}),un(n,Ls,"mouseout",function(i){t.trigger("mouseout",i)}),ve.bind(n,"mousedown",function(i){i.stopPropagation()}),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},st.prototype.getPad=function(e){let t;return console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888")),t=this.isOpen()&&function(n,i){return n=Ee(n)?n:[n],i=Ee(i)?i:[i],n.length===i.length&&ar(n,function(r){return i.includes(r)})}(this._current.target,e)?this._current.html:this._createHtml(e),{html:t}},st.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},st.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return Ee(e)===Ee(n)&&(Ee(e)?e.length===n.length&&ar(e,function(i){return n.includes(i)}):n===e)},st.prototype.isShown=function(){return this.isOpen()&&Ke(this._current.html).has("open")},st.prototype.show=function(){this.isOpen()&&(Ke(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))},st.prototype.hide=function(){this.isOpen()&&(Ke(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},st.prototype._getPosition=function(e){if(!Ee(e)&&Fe(e)){var t=this._canvas.viewbox(),n=(o=e).waypoints[o.waypoints.length-1],i=n.x*t.scale-t.x*t.scale,r=n.y*t.scale-t.y*t.scale;return{left:i+8*this._canvas.zoom(),top:r}}var o,a=this._canvas.getContainer().getBoundingClientRect(),s=this._getTargetBounds(e);return{left:s.right-a.left+8*this._canvas.zoom(),top:s.top-a.top}},st.prototype._updatePosition=function(){this._scheduler.schedule(()=>{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")})}},"ContextPad#_updatePosition")},st.prototype._updateVisibility=function(){this._scheduler.schedule(()=>{if(this.isOpen()){var e=this,t=this._current.target;(Ee(t)?t:[t]).some(function(n){return e._canvas.hasMarker(n,"djs-element-hidden")})?e.hide():e.show()}},"ContextPad#_updateVisibility")},st.prototype._getTargetBounds=function(e){var t=this;return(Ee(e)?e:[e]).map(function(n){return t._canvas.getGraphics(n)}).reduce(function(n,i){const r=i.getBoundingClientRect();return n.top=Math.min(n.top,r.top),n.right=Math.max(n.right,r.right),n.bottom=Math.max(n.bottom,r.bottom),n.left=Math.min(n.left,r.left),n.x=n.left,n.y=n.top,n.width=n.right-n.left,n.height=n.bottom-n.top,n},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};const Vf={__depends__:[Bs,zE,Ts],contextPad:["type",st]};var js,Je,$f,br,Ff,zf,Mu,Nu,Iu,Bu,ea={},Uf=[],UE=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Du=Array.isArray;function Bi(e,t){for(var n in t)e[n]=t[n];return e}function Hf(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Gf(e,t,n){var i,r,o,a={};for(o in t)o=="key"?i=t[o]:o=="ref"?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?js.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return Vs(e,a,i,r,null)}function Vs(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r??++$f,__i:-1,__u:0};return r==null&&Je.vnode!=null&&Je.vnode(o),o}function ta(e){return e.children}function $s(e,t){this.props=e,this.context=t}function no(e,t){if(t==null)return e.__?no(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?no(e):null}function Wf(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Wf(e)}}function qf(e){(!e.__d&&(e.__d=!0)&&br.push(e)&&!Fs.__r++||Ff!==Je.debounceRendering)&&((Ff=Je.debounceRendering)||zf)(Fs)}function Fs(){var e,t,n,i,r,o,a,s;for(br.sort(Mu);e=br.shift();)e.__d&&(t=br.length,i=void 0,o=(r=(n=e).__v).__e,a=[],s=[],n.__P&&((i=Bi({},r)).__v=r.__v+1,Je.vnode&&Je.vnode(i),Ou(n.__P,i,r,n.__n,n.__P.namespaceURI,32&r.__u?[o]:null,a,o??no(r),!!(32&r.__u),s),i.__v=r.__v,i.__.__k[i.__i]=i,Zf(a,i,s),i.__e!=o&&Wf(i)),br.length>t&&br.sort(Mu));Fs.__r=0}function Kf(e,t,n,i,r,o,a,s,c,u,p){var d,m,f,v,g,E=i&&i.__k||Uf,_=t.length;for(n.__d=c,HE(n,t,E),c=n.__d,d=0;d<_;d++)(f=n.__k[d])!=null&&(m=f.__i===-1?ea:E[f.__i]||ea,f.__i=d,Ou(e,f,m,r,o,a,s,c,u,p),v=f.__e,f.ref&&m.ref!=f.ref&&(m.ref&&Lu(m.ref,null,f),p.push(f.ref,f.__c||v,f)),g==null&&v!=null&&(g=v),65536&f.__u||m.__k===f.__k?c=Xf(f,c,e):typeof f.type=="function"&&f.__d!==void 0?c=f.__d:v&&(c=v.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=c,n.__e=g}function HE(e,t,n){var i,r,o,a,s,c=t.length,u=n.length,p=u,d=0;for(e.__k=[],i=0;i<c;i++)(r=t[i])!=null&&typeof r!="boolean"&&typeof r!="function"?(a=i+d,(r=e.__k[i]=typeof r=="string"||typeof r=="number"||typeof r=="bigint"||r.constructor==String?Vs(null,r,null,null,null):Du(r)?Vs(ta,{children:r},null,null,null):r.constructor===void 0&&r.__b>0?Vs(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r).__=e,r.__b=e.__b+1,o=null,(s=r.__i=GE(r,n,a,p))!==-1&&(p--,(o=n[s])&&(o.__u|=131072)),o==null||o.__v===null?(s==-1&&d--,typeof r.type!="function"&&(r.__u|=65536)):s!==a&&(s==a-1?d--:s==a+1?d++:(s>a?d--:d++,r.__u|=65536))):r=e.__k[i]=null;if(p)for(i=0;i<u;i++)(o=n[i])!=null&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=no(o)),Qf(o,o))}function Xf(e,t,n){var i,r;if(typeof e.type=="function"){for(i=e.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=e,t=Xf(i[r],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=no(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function GE(e,t,n,i){var r=e.key,o=e.type,a=n-1,s=n+1,c=t[n];if(c===null||c&&r==c.key&&o===c.type&&!(131072&c.__u))return n;if((typeof o!="function"||o===ta||r)&&i>(c==null||131072&c.__u?0:1))for(;a>=0||s<t.length;){if(a>=0){if((c=t[a])&&!(131072&c.__u)&&r==c.key&&o===c.type)return a;a--}if(s<t.length){if((c=t[s])&&!(131072&c.__u)&&r==c.key&&o===c.type)return s;s++}}return-1}function Yf(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||UE.test(t)?n:n+"px"}function zs(e,t,n,i,r){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Yf(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Yf(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n.u=i.u:(n.u=Nu,e.addEventListener(t,o?Bu:Iu,o)):e.removeEventListener(t,o?Bu:Iu,o);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Jf(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=Nu++;else if(t.t<n.u)return;return Je.event&&(t=Je.event(t)),"handleEvent"in n?n.handleEvent(t):n(t)}}}function Ou(e,t,n,i,r,o,a,s,c,u){var p,d,m,f,v,g,E,_,b,w,S,k,l,h,y,x,C=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),o=[s=t.__e=n.__e]),(p=Je.__b)&&p(t);e:if(typeof C=="function")try{if(_=t.props,b="prototype"in C&&C.prototype.render,w=(p=C.contextType)&&i[p.__c],S=p?w?w.props.value:p.__:i,n.__c?E=(d=t.__c=n.__c).__=d.__E:(b?t.__c=d=new C(_,S):(t.__c=d=new $s(_,S),d.constructor=C,d.render=qE),w&&w.sub(d),d.props=_,d.state||(d.state={}),d.context=S,d.__n=i,m=d.__d=!0,d.__h=[],d._sb=[]),b&&d.__s==null&&(d.__s=d.state),b&&C.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=Bi({},d.__s)),Bi(d.__s,C.getDerivedStateFromProps(_,d.__s))),f=d.props,v=d.state,d.__v=t,m)b&&C.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),b&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(b&&C.getDerivedStateFromProps==null&&_!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(_,S),!d.__e&&(d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(_,d.__s,S)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(N){N&&(N.__=t)}),k=0;k<d._sb.length;k++)d.__h.push(d._sb[k]);d._sb=[],d.__h.length&&a.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(_,d.__s,S),b&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,v,g)})}if(d.context=S,d.props=_,d.__P=e,d.__e=!1,l=Je.__r,h=0,b){for(d.state=d.__s,d.__d=!1,l&&l(t),p=d.render(d.props,d.state,d.context),y=0;y<d._sb.length;y++)d.__h.push(d._sb[y]);d._sb=[]}else do d.__d=!1,l&&l(t),p=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++h<25);d.state=d.__s,d.getChildContext!=null&&(i=Bi(Bi({},i),d.getChildContext())),b&&!m&&d.getSnapshotBeforeUpdate!=null&&(g=d.getSnapshotBeforeUpdate(f,v)),Kf(e,Du(x=p!=null&&p.type===ta&&p.key==null?p.props.children:p)?x:[x],t,n,i,r,o,a,s,c,u),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),E&&(d.__E=d.__=null)}catch(N){if(t.__v=null,c||o!=null){for(t.__u|=c?160:128;s&&s.nodeType===8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else t.__e=n.__e,t.__k=n.__k;Je.__e(N,t,n)}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=WE(n.__e,t,n,i,r,o,a,c,u);(p=Je.diffed)&&p(t)}function Zf(e,t,n){t.__d=void 0;for(var i=0;i<n.length;i++)Lu(n[i],n[++i],n[++i]);Je.__c&&Je.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(o){o.call(r)})}catch(o){Je.__e(o,r.__v)}})}function WE(e,t,n,i,r,o,a,s,c){var u,p,d,m,f,v,g,E=n.props,_=t.props,b=t.type;if(b==="svg"?r="http://www.w3.org/2000/svg":b==="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u<o.length;u++)if((f=o[u])&&"setAttribute"in f==!!b&&(b?f.localName===b:f.nodeType===3)){e=f,o[u]=null;break}}if(e==null){if(b===null)return document.createTextNode(_);e=document.createElementNS(r,b,_.is&&_),s&&(Je.__m&&Je.__m(t,o),s=!1),o=null}if(b===null)E===_||s&&e.data===_||(e.data=_);else{if(o=o&&js.call(e.childNodes),E=n.props||ea,!s&&o!=null)for(E={},u=0;u<e.attributes.length;u++)E[(f=e.attributes[u]).name]=f.value;for(u in E)if(f=E[u],u!="children"){if(u=="dangerouslySetInnerHTML")d=f;else if(!(u in _)){if(u=="value"&&"defaultValue"in _||u=="checked"&&"defaultChecked"in _)continue;zs(e,u,null,f,r)}}for(u in _)f=_[u],u=="children"?m=f:u=="dangerouslySetInnerHTML"?p=f:u=="value"?v=f:u=="checked"?g=f:s&&typeof f!="function"||E[u]===f||zs(e,u,f,E[u],r);if(p)s||d&&(p.__html===d.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(d&&(e.innerHTML=""),Kf(e,Du(m)?m:[m],t,n,i,b==="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,a,o?o[0]:n.__k&&no(n,0),s,c),o!=null)for(u=o.length;u--;)Hf(o[u]);s||(u="value",b==="progress"&&v==null?e.removeAttribute("value"):v!==void 0&&(v!==e[u]||b==="progress"&&!v||b==="option"&&v!==E[u])&&zs(e,u,v,E[u],r),u="checked",g!==void 0&&g!==e[u]&&zs(e,u,g,E[u],r))}return e}function Lu(e,t,n){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&t==null||(e.__u=e(t))}else e.current=t}catch(r){Je.__e(r,n)}}function Qf(e,t,n){var i,r;if(Je.unmount&&Je.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Lu(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){Je.__e(o,t)}i.base=i.__P=null}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Qf(i[r],t,n||typeof e.type!="function");n||Hf(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function qE(e,t,n){return this.constructor(e,n)}function ev(e,t,n){var i,r,o,a;Je.__&&Je.__(e,t),r=(i=typeof n=="function")?null:t.__k,o=[],a=[],Ou(t,e=(!i&&n||t).__k=Gf(ta,null,[e]),r||ea,ea,t.namespaceURI,!i&&n?[n]:r?null:t.firstChild?js.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i,a),Zf(o,e,a)}js=Uf.slice,Je={__e:function(e,t,n,i){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(e)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,i||{}),a=r.__d),a)return r.__E=r}catch(s){e=s}throw e}},$f=0,$s.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Bi({},this.state),typeof e=="function"&&(e=e(Bi({},n),this.props)),e&&Bi(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),qf(this))},$s.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),qf(this))},$s.prototype.render=ta,br=[],zf=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Mu=function(e,t){return e.__v.__b-t.__v.__b},Fs.__r=0,Nu=0,Iu=Jf(!1),Bu=Jf(!0);var io,lt,ju,tv,nv=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];a===3?i[0]=s:a===4?i[1]=Object.assign(i[1]||{},s):a===5?(i[1]=i[1]||{})[t[++o]]=s:a===6?i[1][t[++o]]+=s+"":a?(r=e.apply(s,nv(e,s,n,["",null])),i.push(r),s[0]?t[0]|=2:(t[o-2]=0,t[o]=r)):i.push(s)}return i},iv=new Map,tt=(function(e){var t=iv.get(this);return t||(t=new Map,iv.set(this,t)),(t=nv(this,t.get(e)||(t.set(e,t=function(n){for(var i,r,o=1,a="",s="",c=[0],u=function(m){o===1&&(m||(a=a.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?c.push(0,m,a):o===3&&(m||a)?(c.push(3,m,a),o=2):o===2&&a==="..."&&m?c.push(4,m,0):o===2&&a&&!m?c.push(5,0,!0,a):o>=5&&((a||!m&&o===5)&&(c.push(o,0,a,r),o=6),m&&(c.push(o,m,0,r),o=6)),a=""},p=0;p<n.length;p++){p&&(o===1&&u(),u(p));for(var d=0;d<n[p].length;d++)i=n[p][d],o===1?i==="<"?(u(),c=[c],o=3):a+=i:o===4?a==="--"&&i===">"?(o=1,a=""):a=i+a[0]:s?i===s?s="":a+=i:i==='"'||i==="'"?s=i:i===">"?(u(),o=1):o&&(i==="="?(o=5,r=a,a=""):i==="/"&&(o<5||n[p][d+1]===">")?(u(),o===3&&(c=c[0]),o=c,(c=c[0]).push(2,0,o),o=0):i===" "||i===" "||i===`
  10. `||i==="\r"?(u(),o=2):a+=i),o===3&&a==="!--"&&(o=4,c=c[0])}return u(),c}(e)),t),arguments,[])).length>1?t:t[0]}).bind(Gf),na=0,rv=[],mt=Je,ov=mt.__b,av=mt.__r,sv=mt.diffed,lv=mt.__c,cv=mt.unmount,uv=mt.__;function Us(e,t){mt.__h&&mt.__h(lt,e,na||t),na=0;var n=lt.__H||(lt.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Vu(e){return na=1,function(t,n){var i=Us(io++,2);if(i.t=t,!i.__c&&(i.__=[hv(void 0,n),function(s){var c=i.__N?i.__N[0]:i.__[0],u=i.t(c,s);c!==u&&(i.__N=[u,i.__[1]],i.__c.setState({}))}],i.__c=lt,!lt.u)){var r=function(s,c,u){if(!i.__c.__H)return!0;var p=i.__c.__H.__.filter(function(m){return!!m.__c});if(p.every(function(m){return!m.__N}))return!o||o.call(this,s,c,u);var d=i.__c.props!==s;return p.forEach(function(m){if(m.__N){var f=m.__[0];m.__=m.__N,m.__N=void 0,f!==m.__[0]&&(d=!0)}}),o&&o.call(this,s,c,u)||d};lt.u=!0;var o=lt.shouldComponentUpdate,a=lt.componentWillUpdate;lt.componentWillUpdate=function(s,c,u){if(this.__e){var p=o;o=void 0,r(s,c,u),o=p}a&&a.call(this,s,c,u)},lt.shouldComponentUpdate=r}return i.__N||i.__}(hv,e)}function $u(e,t){var n=Us(io++,3);!mt.__s&&Uu(n.__H,t)&&(n.__=e,n.i=t,lt.__H.__h.push(n))}function Fu(e,t){var n=Us(io++,4);!mt.__s&&Uu(n.__H,t)&&(n.__=e,n.i=t,lt.__h.push(n))}function pv(e){return na=5,ro(function(){return{current:e}},[])}function ro(e,t){var n=Us(io++,7);return Uu(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ia(e,t){return na=8,ro(function(){return e},t)}function KE(){for(var e;e=rv.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Hs),e.__H.__h.forEach(zu),e.__H.__h=[]}catch(t){e.__H.__h=[],mt.__e(t,e.__v)}}mt.__b=function(e){lt=null,ov&&ov(e)},mt.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),uv&&uv(e,t)},mt.__r=function(e){av&&av(e),io=0;var t=(lt=e.__c).__H;t&&(ju===lt?(t.__h=[],lt.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(Hs),t.__h.forEach(zu),t.__h=[],io=0)),ju=lt},mt.diffed=function(e){sv&&sv(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(rv.push(t)!==1&&tv===mt.requestAnimationFrame||((tv=mt.requestAnimationFrame)||XE)(KE)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),ju=lt=null},mt.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Hs),n.__h=n.__h.filter(function(i){return!i.__||zu(i)})}catch(i){t.some(function(r){r.__h&&(r.__h=[])}),t=[],mt.__e(i,n.__v)}}),lv&&lv(e,t)},mt.unmount=function(e){cv&&cv(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(i){try{Hs(i)}catch(r){t=r}}),n.__H=void 0,t&&mt.__e(t,n.__v))};var dv=typeof requestAnimationFrame=="function";function XE(e){var t,n=function(){clearTimeout(i),dv&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);dv&&(t=requestAnimationFrame(n))}function Hs(e){var t=lt,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),lt=t}function zu(e){var t=lt;e.__c=e.__(),lt=t}function Uu(e,t){return!e||e.length!==t.length||t.some(function(n,i){return n!==e[i]})}function hv(e,t){return typeof t=="function"?t(e):t}function mv(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=mv(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Gs(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=mv(e))&&(i&&(i+=" "),i+=t);return i}function YE(e){const{headerEntries:t,onSelect:n,selectedEntry:i,setSelectedEntry:r,title:o}=e,a=ro(()=>t.reduce((s,c)=>{const u=c.group||"default",p=s.find(d=>d.id===u);return p?p.entries.push(c):s.push({id:u,entries:[c]}),s},[]),[t]);return tt`
  11. <div class="djs-popup-header">
  12. <h3 class="djs-popup-title" title=${o}>${o}</h3>
  13. ${a.map(s=>tt`
  14. <ul key=${s.id} class="djs-popup-header-group" data-header-group=${s.id}>
  15. ${s.entries.map(c=>tt`
  16. <li key=${c.id}>
  17. <${c.action?"button":"span"}
  18. class=${function(u,p){return Gs("entry",u.className,u.active?"active":"",u.disabled?"disabled":"",p?"selected":"")}(c,c===i)}
  19. onClick=${u=>c.action&&n(u,c)}
  20. title=${c.title||c.label}
  21. data-id=${c.id}
  22. onMouseEnter=${()=>c.action&&r(c)}
  23. onMouseLeave=${()=>c.action&&r(null)}
  24. onFocus=${()=>c.action&&r(c)}
  25. onBlur=${()=>c.action&&r(null)}
  26. >
  27. ${c.imageUrl&&tt`<img class="djs-popup-entry-icon" src=${c.imageUrl} alt="" />`||c.imageHtml&&tt`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${{__html:c.imageHtml}} />`}
  28. ${c.label?tt`
  29. <span class="djs-popup-label">${c.label}</span>
  30. `:null}
  31. </${c.action?"button":"span"}>
  32. </li>
  33. `)}
  34. </ul>
  35. `)}
  36. </div>
  37. `}function JE(e){const{entry:t,selected:n,onMouseEnter:i,onMouseLeave:r,onAction:o}=e;return tt`
  38. <li
  39. class=${Gs("entry",{selected:n})}
  40. data-id=${t.id}
  41. title=${t.title||t.label}
  42. tabIndex="0"
  43. onClick=${o}
  44. onFocus=${i}
  45. onBlur=${r}
  46. onMouseEnter=${i}
  47. onMouseLeave=${r}
  48. onDragStart=${a=>o(a,t,"dragstart")}
  49. draggable=${!0}
  50. >
  51. <div class="djs-popup-entry-content">
  52. <span
  53. class=${Gs("djs-popup-entry-name",t.className)}
  54. >
  55. ${t.imageUrl&&tt`<img class="djs-popup-entry-icon" src=${t.imageUrl} alt="" />`||t.imageHtml&&tt`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${{__html:t.imageHtml}} />`}
  56. ${t.label?tt`
  57. <span class="djs-popup-label">
  58. ${t.label}
  59. </span>
  60. `:null}
  61. </span>
  62. ${t.description&&tt`
  63. <span
  64. class="djs-popup-entry-description"
  65. title=${t.description}
  66. >
  67. ${t.description}
  68. </span>
  69. `}
  70. </div>
  71. ${t.documentationRef&&tt`
  72. <div class="djs-popup-entry-docs">
  73. <a
  74. href="${t.documentationRef}"
  75. onClick=${a=>a.stopPropagation()}
  76. title="Open element documentation"
  77. target="_blank"
  78. rel="noopener"
  79. >
  80. <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
  81. <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="#818798"/>
  82. </svg>
  83. </a>
  84. </div>
  85. `}
  86. </li>
  87. `}function ZE(e){const{selectedEntry:t,setSelectedEntry:n,entries:i,...r}=e,o=pv(),a=ro(()=>function(s){const c=[],u=p=>c.find(d=>p.id===d.id);return s.forEach(p=>{const d=p.group?(m=>typeof m=="string"?{id:m}:m)(p.group):{id:"default"};(m=>!!u(m))(d)?u(d).entries.push(p):c.push({...d,entries:[p]})}),c}(i),[i]);return Fu(()=>{const s=o.current;if(!s)return;const c=s.querySelector(".selected");var u;c&&(typeof(u=c).scrollIntoViewIfNeeded=="function"?u.scrollIntoViewIfNeeded():u.scrollIntoView({scrollMode:"if-needed",block:"nearest"}))},[t]),tt`
  88. <div class="djs-popup-results" ref=${o}>
  89. ${a.map(s=>tt`
  90. ${s.name&&tt`
  91. <div key=${s.id} class="entry-header" title=${s.name}>
  92. ${s.name}
  93. </div>
  94. `}
  95. <ul class="djs-popup-group" data-group=${s.id}>
  96. ${s.entries.map(c=>tt`
  97. <${JE}
  98. key=${c.id}
  99. entry=${c}
  100. selected=${c===t}
  101. onMouseEnter=${()=>n(c)}
  102. onMouseLeave=${()=>n(null)}
  103. ...${r}
  104. />
  105. `)}
  106. </ul>
  107. `)}
  108. </div>
  109. `}function QE(e){const{onClose:t,onSelect:n,className:i,headerEntries:r,position:o,title:a,width:s,scale:c,search:u,emptyPlaceholder:p,entries:d,onOpened:m,onClosed:f}=e,v=ro(()=>!!xt(u)&&d.length>5,[u,d]),[g,E]=Vu(""),_=ia((N,O)=>v?N.filter(B=>{if(!O)return(B.rank||0)>=0;if(B.searchable===!1)return!1;const H=[B.description||"",B.label||"",B.search||""].map(q=>q.toLowerCase());return O.toLowerCase().split(/\s/g).every(q=>H.some(U=>U.includes(q)))}):N,[v]),[b,w]=Vu(_(d,g)),[S,k]=Vu(b[0]),l=ia(N=>{S&&N.includes(S)||k(N[0]),w(N)},[S,w,k]);$u(()=>{l(_(d,g))},[g,d]);const h=ia(N=>{let O=b.indexOf(S)+N;O<0&&(O=b.length-1),O>=b.length&&(O=0),k(b[O])},[b,S,k]),y=ia(N=>N.key==="Enter"&&S?n(N,S):N.key==="ArrowUp"?(h(-1),N.preventDefault()):N.key==="ArrowDown"?(h(1),N.preventDefault()):void 0,[n,S,h]),x=ia(N=>{is(N.target,"input")&&E(()=>N.target.value)},[E]);$u(()=>(m(),()=>{f()}),[]);const C=ro(()=>a||r.length>0,[a,r]);return tt`
  110. <${fv}
  111. onClose=${t}
  112. onKeyup=${x}
  113. onKeydown=${y}
  114. className=${i}
  115. position=${o}
  116. width=${s}
  117. scale=${c}
  118. >
  119. ${C&&tt`
  120. <${YE}
  121. headerEntries=${r}
  122. onSelect=${n}
  123. selectedEntry=${S}
  124. setSelectedEntry=${k}
  125. title=${a}
  126. />
  127. `}
  128. ${d.length>0&&tt`
  129. <div class="djs-popup-body">
  130. ${v&&tt`
  131. <div class="djs-popup-search">
  132. <svg class="djs-popup-search-icon" width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
  133. <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"/>
  134. </svg>
  135. <input type="text" spellcheck=${!1} aria-label="${a}" />
  136. </div>
  137. `}
  138. <${ZE}
  139. entries=${b}
  140. selectedEntry=${S}
  141. setSelectedEntry=${k}
  142. onAction=${n}
  143. />
  144. </div>
  145. `}
  146. ${p&&b.length===0&&tt`
  147. <div class="djs-popup-no-results">${rt(p)?p(g):p}</div>
  148. `}
  149. </${fv}>
  150. `}function fv(e){const{onClose:t,onKeydown:n,onKeyup:i,className:r,children:o,position:a}=e,s=pv();return Fu(()=>{if(typeof a!="function")return;const c=s.current,u=a(c);c.style.left=`${u.x}px`,c.style.top=`${u.y}px`},[s.current,a]),Fu(()=>{const c=s.current;c&&(c.querySelector("input")||c).focus()},[]),$u(()=>{const c=p=>{if(p.key==="Escape")return p.preventDefault(),t()},u=p=>{if(!Zn(p.target,".djs-popup",!0))return t()};return document.documentElement.addEventListener("keydown",c),document.body.addEventListener("click",u),()=>{document.documentElement.removeEventListener("keydown",c),document.body.removeEventListener("click",u)}},[]),tt`
  151. <div
  152. class=${Gs("djs-popup",r)}
  153. style=${function(c){return{transform:`scale(${c.scale})`,width:`${c.width}px`,"transform-origin":"top left"}}(e)}
  154. onKeydown=${n}
  155. onKeyup=${i}
  156. ref=${s}
  157. tabIndex="-1"
  158. >
  159. ${o}
  160. </div>
  161. `}var vv=["contextPad.close","canvas.viewbox.changing","commandStack.changed"];function Ze(e,t,n){this._eventBus=t,this._canvas=n,this._current=null;var i=xt(e&&e.scale)?e.scale:{min:1,max:1};this._config={scale:i},t.on("diagram.destroy",()=>{this.close()}),t.on("element.changed",r=>{const o=this.isOpen()&&this._current.target;r.element===o&&this.refresh()})}Ze.$inject=["config.popupMenu","eventBus","canvas"],Ze.prototype._render=function(){const{position:e,providerId:t,entries:n,headerEntries:i,emptyPlaceholder:r,options:o}=this._current,a=Object.entries(n).map(([p,d])=>({id:p,...d})),s=Object.entries(i).map(([p,d])=>({id:p,...d})),c=e&&(p=>this._ensureVisible(p,e)),u=this._updateScale(this._current.container);ev(tt`
  162. <${QE}
  163. onClose=${p=>this.close(p)}
  164. onSelect=${(p,d,m)=>this.trigger(p,d,m)}
  165. position=${c}
  166. className=${t}
  167. entries=${a}
  168. headerEntries=${s}
  169. emptyPlaceholder=${r}
  170. scale=${u}
  171. onOpened=${this._onOpened.bind(this)}
  172. onClosed=${this._onClosed.bind(this)}
  173. ...${{...o}}
  174. />
  175. `,this._current.container)},Ze.prototype.open=function(e,t,n,i){if(!e)throw new Error("target is missing");if(!t)throw new Error("providers for <"+t+"> not found");if(!n)throw new Error("position is missing");this.isOpen()&&this.close();const{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()},Ze.prototype.refresh=function(){if(!this.isOpen())return;const{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()},Ze.prototype._getContext=function(e,t){const n=this._getProviders(t);if(!n||!n.length)throw new Error("provider for <"+t+"> not found");const 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)}},Ze.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._current=null)},Ze.prototype.reset=function(){const e=this._current.container;ev(null,e),Fn(e)},Ze.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)},Ze.prototype._onOpened=function(){this._emit("opened")},Ze.prototype._onClosed=function(){this._emit("closed")},Ze.prototype._createContainer=function(e){var t=this._canvas.getContainer();const n=He(`<div class="djs-popup-parent djs-scrollable" data-popup=${e.provider}></div>`);return t.appendChild(n),n},Ze.prototype._bindAutoClose=function(){this._eventBus.once(vv,this.close,this)},Ze.prototype._unbindAutoClose=function(){this._eventBus.off(vv,this.close,this)},Ze.prototype._updateScale=function(){var e,t,n=this._canvas.zoom(),i=this._config.scale,r=n;return i!==!0&&(i===!1?(e=1,t=1):(e=i.min,t=i.max),xt(e)&&n<e&&(r=e),xt(t)&&n>t&&(r=t)),r},Ze.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}},Ze.prototype.isEmpty=function(e,t){if(!e)throw new Error("target is missing");if(!t)throw new Error("provider ID is missing");const n=this._getProviders(t);return!n||!n.length||this._getContext(e,t).empty},Ze.prototype.registerProvider=function(e,t,n){n||(n=t,t=1e3),this._eventBus.on("popupMenu.getProviders."+e,t,function(i){i.providers.push(n)})},Ze.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},Ze.prototype._getEntries=function(e,t){var n={};return $(t,function(i){if(i.getPopupMenuEntries){var r=i.getPopupMenuEntries(e);rt(r)?n=r(n):$(r,function(o,a){n[a]=o})}else $(i.getEntries(e),function(o){var a=o.id;if(!a)throw new Error("entry ID is missing");n[a]=cn(o,["id"])})}),n},Ze.prototype._getHeaderEntries=function(e,t){var n={};return $(t,function(i){if(i.getPopupMenuHeaderEntries){var r=i.getPopupMenuHeaderEntries(e);rt(r)?n=r(n):$(r,function(o,a){n[a]=o})}else{if(!i.getHeaderEntries)return;$(i.getHeaderEntries(e),function(o){var a=o.id;if(!a)throw new Error("entry ID is missing");n[a]=cn(o,["id"])})}}),n},Ze.prototype._getEmptyPlaceholder=function(e){const t=e.find(n=>rt(n.getEmptyPlaceholder));return t&&t.getEmptyPlaceholder()},Ze.prototype.isOpen=function(){return!!this._current},Ze.prototype.trigger=function(e,t,n="click"){if(e.preventDefault(),!t){let r=It(Zn(e.delegateTarget||e.target,".entry",!0),"data-id");t={id:r,...this._getEntry(r)}}const i=t.action;if(this._emit("trigger",{entry:t,event:e})!==!1){if(rt(i)){if(n==="click")return i(e,t)}else if(i[n])return i[n](e,t)}},Ze.prototype._getEntry=function(e){var t=this._current.entries[e]||this._current.headerEntries[e];if(!t)throw new Error("entry not found");return t};const Hu={__init__:["popupMenu"],popupMenu:["type",Ze]};var yv={align:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">
  176. <line x1="200" y1="150" x2="200" y2="1850" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
  177. <rect x="500" y="150" width="1300" height="700" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  178. <rect x="500" y="1150" width="700" height="700" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  179. </svg>`,bottom:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
  180. <line x1="150" y1="1650" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
  181. <rect x="150" y="350" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  182. <rect x="1050" y="850" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  183. </svg>`,center:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
  184. <line x1="900" y1="150" x2="900" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
  185. <rect x="250" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  186. <rect x="500" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  187. </svg>`,left:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
  188. <line x1="100" y1="150" x2="100" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
  189. <rect x="100" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  190. <rect x="100" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  191. </svg>`,right:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
  192. <line x1="1650" y1="150" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
  193. <rect x="350" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  194. <rect x="850" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  195. </svg>`,top:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
  196. <line x1="150" y1="150" x2="1650" y2="150" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
  197. <rect x="150" y="150" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  198. <rect x="1050" y="150" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  199. </svg>`,middle:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
  200. <line x1="150" y1="900" x2="1650" y2="900" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>
  201. <rect x="150" y="250" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  202. <rect x="1050" y="500" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  203. </svg>`};function oo(e,t,n,i){e.registerProvider(900,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=i}oo.$inject=["contextPad","popupMenu","translate","canvas"],oo.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&z(t,this._getEntries(e)),t},oo.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")},oo.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`<div class="entry">${yv.align}</div>`,action:{click:function(t,n){var i=e._getMenuPosition(n);z(i,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",i)}}}}},oo.prototype._getMenuPosition=function(e){var t=this._contextPad.getPad(e).html.getBoundingClientRect();return{x:t.left,y:t.bottom+5}};var e1=["left","center","right","top","middle","bottom"];function ra(e,t,n,i){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",this)}function mn(e){Z.call(this,e),this.init()}function Ws(e){mn.call(this,e)}ra.$inject=["popupMenu","alignElements","translate","rules"],ra.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&z(t,this._getEntries(e)),t},ra.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})},ra.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,i=this._popupMenu,r={};return $(e1,function(o){r["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:yv[o],action:function(){t.trigger(e,o),i.close()}}}),r},mn.$inject=["eventBus"],le(mn,Z),mn.prototype.addRule=function(e,t,n){var i=this;typeof e=="string"&&(e=[e]),e.forEach(function(r){i.canExecute(r,t,function(o,a,s){return n(o)},!0)})},mn.prototype.init=function(){},Ws.$inject=["eventBus"],le(Ws,mn),Ws.prototype.init=function(){this.addRule("elements.align",function(e){var t=Ce(e.elements,function(n){return!(n.waypoints||n.host||n.labelTarget)});return!((t=ls(t)).length<2)&&t})};const t1={__depends__:[$E,Vf,Hu],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",oo],alignElementsMenuProvider:["type",ra],bpmnAlignElements:["type",Ws]};function Gu(e,t,n,i){for(var r;r=n1(e,n,t);)n=i(t,n,r);return n}function Wu(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=o==="x"?"width":"height",c=a.margin,u=a.minDistance;r[o]=c<0?Math.min(i[o]+c-t[s]/2,n[o]-u+c):Math.max(i[o]+i[s]+c+t[s]/2,n[o]+u+c)}}),r}}function n1(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},r=function(o){var a=qu(o);return o.host&&(a=a.concat(qu(o.host))),o.attachers&&(a=a.concat(o.attachers.reduce(function(s,c){return s.concat(qu(c))},[]))),a}(e);return Be(r,function(o){return o!==n&&Tt(o,i,10)==="intersect"})}function qu(e){return(t=e,t.outgoing.map(function(n){return n.target})).concat(function(n){return n.incoming.map(function(i){return i.source})}(e));var t}function i1(){return!0}function gv(e,t,n){e.on("autoPlace",100,function(i){var r=i.shape;return function(o,a,s){s||(s={});var c=s.defaultDistance||50,u=ge(o);return{x:de(o).right+c+a.width/2,y:u.y}}(i.source,r)}),e.on("autoPlace.end",function(i){n.scrollToElement(i.shape)}),this.append=function(i,r,o){e.fire("autoPlace.start",{source:i,shape:r});var a=e.fire("autoPlace",{source:i,shape:r}),s=t.appendShape(i,r,a,i.parent,o);return e.fire("autoPlace.end",{source:i,shape:s}),s}}function bv(e,t){e.on("autoPlace.end",500,function(n){t.select(n.shape)})}gv.$inject=["eventBus","modeling","canvas"],bv.$inject=["eventBus","selection"];const r1={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",gv],autoPlaceSelectionBehavior:["type",bv]};function ao(e,t){for(Ut(t)&&(t=[t]);e=e.parent;)if(Se(e,t))return e;return null}function xv(e,t){var n=ao(e,"bpmn:Process");if(n)return!0;var i,r=["bpmn:Participant","bpmn:Lane"];if(n=ao(e,r))return gt(n);if(Se(e,r))return gt(e);for(i=Q(e);i&&!P(i,"bpmn:Process");i=i.$parent);if(!t)return!0;var o=t.find(function(a){var s=Q(a);return s&&s.get("processRef")===i});return!o||gt(o)}function _v(e,t,n){var i=xv(e,n);return P(t,"bpmn:TextAnnotation")?function(r,o,a){var s=de(r),c=a?{x:s.right+o.width/2,y:s.top-50-o.height/2}:{x:s.right+50+o.width/2,y:s.bottom+o.height/2};Fe(r)&&(c=ge(r),a?(c.x+=100,c.y-=50):(c.x+=100,c.y+=50));var u={margin:a?-30:30,minDistance:20};return Gu(r,o,c,Wu(a?{y:u}:{x:u}))}(e,t,i):Se(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?function(r,o,a){var s=de(r),c={margin:30,minDistance:30};return Gu(r,o,a?{x:s.right-10+o.width/2,y:s.bottom+40+o.width/2}:{x:s.left-40-o.width/2,y:s.bottom-10+o.height/2},Wu(a?{x:c}:{y:c}))}(e,t,i):P(t,"bpmn:FlowNode")?function(r,o,a){var s=de(r),c=ge(r),u=a?{directionHint:"e",minDistance:80,baseOrientation:"left",boundaryOrientation:"top",start:"top",end:"bottom"}:{directionHint:"s",minDistance:90,baseOrientation:"top",boundaryOrientation:"left",start:"left",end:"right"},p=function(g,E){E||(E={});var _=E.defaultDistance||50,b=E.direction||"e",w=E.filter,S=E.getWeight||function(N){return N.source===g?1:-1},k=E.maxDistance||250,l=E.reference||"start";function h(N,O){return b==="n"?l==="start"?de(N).top-de(O).bottom:l==="center"?de(N).top-ge(O).y:de(N).top-de(O).top:b==="w"?l==="start"?de(N).left-de(O).right:l==="center"?de(N).left-ge(O).x:de(N).left-de(O).left:b==="s"?l==="start"?de(O).top-de(N).bottom:l==="center"?ge(O).y-de(N).bottom:de(O).bottom-de(N).bottom:l==="start"?de(O).left-de(N).right:l==="center"?ge(O).x-de(N).right:de(O).right-de(N).right}w||(w=i1);var y=g.incoming.filter(w).map(function(N){var O=S(N),B=O<0?h(N.source,g):h(g,N.source);return{id:N.source.id,distance:B,weight:O}}),x=g.outgoing.filter(w).map(function(N){var O=S(N),B=O>0?h(g,N.target):h(N.target,g);return{id:N.target.id,distance:B,weight:O}}),C=Ht(y.concat(x).reduce(function(N,O){return N[O.id+"__weight_"+O.weight]=O,N},{}),function(N,O){var B=O.distance,H=O.weight;return B<0||B>k||(N[String(B)]||(N[String(B)]=0),N[String(B)]+=1*H,(!N.distance||N[N.distance]<N[String(B)])&&(N.distance=B)),N},{});return C.distance||_}(r,{filter:function(g){return P(g,"bpmn:SequenceFlow")},direction:u.directionHint}),d=30,m=u.minDistance,f=u.baseOrientation;P(r,"bpmn:BoundaryEvent")&&(f=Tt(r,r.host,-25)).indexOf(u.boundaryOrientation)!==-1&&(d*=-1);var v={margin:d,minDistance:m};return Gu(r,o,a?{x:s.right+p+o.width/2,y:c.y+Ev(f,m,u)}:{x:c.x+Ev(f,m,u),y:s.bottom+p+o.height/2},Wu(a?{y:v}:{x:v}))}(e,t,i):void 0}function Ev(e,t,n){return e.includes(n.start)?-1*t:e.includes(n.end)?t:0}function wv(e,t){e.on("autoPlace",function(n){var i=n.shape;return _v(n.source,i,t)})}wv.$inject=["eventBus","elementRegistry"];const Ku={__depends__:[r1],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",wv]};function li(e,t,n,i){Z.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=i;var r=this;this.postExecuted(["shape.create"],function(o){var a=o.context,s=a.hints||{},c=a.shape,u=a.parent||a.newParent;s.autoResize!==!1&&r._expand([c],u)}),this.postExecuted(["elements.move"],function(o){var a=o.context,s=$c(Fc(a.closure.topLevel)),c=a.hints,u=!c||c.autoResize;u!==!1&&$(zr(s,function(p){return p.parent.id}),function(p,d){Ee(u)&&(p=p.filter(function(m){return Be(u,Tn({id:m.id}))})),r._expand(p,d)})}),this.postExecuted(["shape.toggleCollapse"],function(o){var a=o.context,s=a.hints,c=a.shape;s&&s.autoResize===!1||c.collapsed||r._expand(c.children||[],c)}),this.postExecuted(["shape.resize"],function(o){var a=o.context,s=a.hints,c=a.shape,u=c.parent;s&&s.autoResize===!1||u&&r._expand([c],u)})}function qs(e){e.invoke(li,this)}function oa(e){mn.call(this,e);var t=this;this.addRule("element.autoResize",function(n){return t.canResize(n.elements,n.target)})}function Ks(e,t){oa.call(this,e),this._modeling=t}li.$inject=["eventBus","elementRegistry","modeling","rules"],le(li,Z),li.prototype._getOptimalBounds=function(e,t){var n=this.getOffset(t),i=this.getPadding(t),r=de(yt(e)),o=de(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),hs(z({},o,a))},li.prototype._expand=function(e,t){if(typeof t=="string"&&(t=this._elementRegistry.get(t)),this._rules.allowed("element.autoResize",{elements:e,target:t})){var n=this._getOptimalBounds(e,t);if(function(o,a){return o.x!==a.x||o.y!==a.y||o.width!==a.width||o.height!==a.height}(n,t)){var i=function(o,a){var s="";return o=de(o),a=de(a),o.top>a.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}(Pn(t,["x","y","width","height"]),n);this.resize(t,n,{autoResize:i});var r=t.parent;r&&this._expand([t],r)}}},li.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},li.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},li.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)},qs.$inject=["injector"],le(qs,li),qs.prototype.resize=function(e,t,n){P(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)},oa.$inject=["eventBus"],le(oa,mn),oa.prototype.canResize=function(e,t){return!1},le(Ks,oa),Ks.$inject=["eventBus","modeling"],Ks.prototype.canResize=function(e,t){if(P(t.di,"bpmndi:BPMNPlane")||!P(t,"bpmn:Participant")&&!P(t,"bpmn:Lane")&&!P(t,"bpmn:SubProcess"))return!1;var n=!0;return $(e,function(i){(P(i,"bpmn:Lane")||Re(i))&&(n=!1)}),n};const o1={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",qs],bpmnAutoResizeProvider:["type",Ks]};function Sv(e,t,n){var i,r,o=this,a=n.get("dragging",!1);a&&t.on("drag.start",function(s){t.once("drag.move",1500,function(c){(function(u){if(!u.hover){var p=u.originalEvent,d=o._findTargetGfx(p),m=d&&e.get(d);d&&m&&(u.stopPropagation(),a.hover({element:m,gfx:d}),a.move(p))}})(c)})}),t.on("element.hover",function(s){i=s.gfx,r=s.element}),t.on("element.hover",1500,function(s){r&&t.fire("element.out",{element:r,gfx:i})}),t.on("element.out",function(){i=null,r=null}),this._findTargetGfx=function(s){var c;if(s instanceof MouseEvent)return c=gr(s),Zn(document.elementFromPoint(c.x,c.y),"svg, .djs-element",!0)}}Sv.$inject=["elementRegistry","eventBus","injector"];const a1={__init__:["hoverFix"],hoverFix:["type",Sv]};var so=Math.round,Cv="djs-drag-active";function xr(e){e.preventDefault()}function kv(e,t,n,i){var r,o={threshold:5,trapClick:!0};function a(_){var b=t.viewbox(),w=t._container.getBoundingClientRect();return{x:b.x+(_.x-w.left)/b.scale,y:b.y+(_.y-w.top)/b.scale}}function s(_,b){b=b||r;var w=e.createEvent(z({},b.payload,b.data,{isTouch:b.isTouch}));return e.fire("drag."+_,w)!==!1&&e.fire(b.prefix+"."+_,w)}function c(_,b){var w,S=r.payload,k=r.displacement,l=r.globalStart,h=gr(_),y=Rn(h,l),x=r.localStart,C=a(h),N=Rn(C,x);if(!r.active&&(b||(w=y,Math.sqrt(Math.pow(w.x,2)+Math.pow(w.y,2))>r.threshold))){if(z(S,{x:so(x.x+k.x),y:so(x.y+k.y),dx:0,dy:0},{originalEvent:_}),s("start")===!1)return g();r.active=!0,r.keepSelection||(S.previousSelection=n.get(),n.select(null)),r.cursor&&Os(r.cursor),t.addMarker(t.getRootElement(),Cv)}Su(_),r.active&&(z(S,{x:so(C.x+k.x),y:so(C.y+k.y),dx:so(N.x),dy:so(N.y)},{originalEvent:_}),s("move"))}function u(_){var b=!0;r.active&&(_&&(r.payload.originalEvent=_,Su(_)),b=s("end")),b===!1&&s("rejected"),s("ended",E(b!==!0))}function p(_){bt("Escape",_)&&(xr(_),g())}function d(_){var b;r.active&&(b=Nf(e),setTimeout(b,400),xr(_)),u(_)}function m(_){c(_)}function f(_){var b=r.payload;b.hoverGfx=_.gfx,b.hover=_.element,s("hover")}function v(_){s("out");var b=r.payload;b.hoverGfx=null,b.hover=null}function g(_){var b;if(r){var w=r.active;w&&s("cancel"),b=E(_),w&&s("canceled",b)}}function E(_){var b,w;s("cleanup"),Mf(),w=r.trapClick?d:u,ve.unbind(document,"mousemove",c),ve.unbind(document,"dragstart",xr),ve.unbind(document,"selectstart",xr),ve.unbind(document,"mousedown",w,!0),ve.unbind(document,"mouseup",w,!0),ve.unbind(document,"keyup",p),ve.unbind(document,"touchstart",m,!0),ve.unbind(document,"touchcancel",g,!0),ve.unbind(document,"touchmove",c,!0),ve.unbind(document,"touchend",u,!0),e.off("element.hover",f),e.off("element.out",v),t.removeMarker(t.getRootElement(),Cv);var S=r.payload.previousSelection;return _!==!1&&S&&!n.get().length&&function(k){var l=k.filter(function(h){return i.get(h.id)});l.length&&n.select(l)}(S),b=r,r=null,b}e.on("diagram.destroy",g),this.init=function(_,b,w,S){r&&g(!1),typeof b=="string"&&(S=w,w=b,b=null);var k,l,h,y,x,C=(S=z({},o,S||{})).data||{};y=S.trapClick?d:u,_?(k=Jr(_)||_,l=gr(_),Su(_),k.type==="dragstart"&&xr(k)):(k=null,l={x:0,y:0}),h=a(l),b||(b=h),x=function(N){return typeof TouchEvent<"u"&&N instanceof TouchEvent}(k),r=z({prefix:w,data:C,payload:{},globalStart:l,displacement:Rn(b,h),localStart:h,isTouch:x},S),S.manual||(x?(ve.bind(document,"touchstart",m,!0),ve.bind(document,"touchcancel",g,!0),ve.bind(document,"touchmove",c,!0),ve.bind(document,"touchend",u,!0)):(ve.bind(document,"mousemove",c),ve.bind(document,"dragstart",xr),ve.bind(document,"selectstart",xr),ve.bind(document,"mousedown",y,!0),ve.bind(document,"mouseup",y,!0)),ve.bind(document,"keyup",p),e.on("element.hover",f),e.on("element.out",v)),s("init"),S.autoActivate&&c(_,!0)},this.move=c,this.hover=f,this.out=v,this.end=u,this.cancel=g,this.context=function(){return r},this.setOptions=function(_){z(o,_)}}kv.$inject=["eventBus","canvas","selection","elementRegistry"];const ci={__depends__:[a1,Gn],dragging:["type",kv]};function lo(e,t,n){this._canvas=n,this._opts=z({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var i=this;t.on("drag.move",function(r){var o=i._toBorderPoint(r);i.startScroll(o)}),t.on(["drag.cleanup"],function(){i.stopScroll()})}lo.$inject=["config.autoScroll","eventBus","canvas"],lo.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 u=0,p=0,d=0;d<4;d++)t=c[d],n=o.scrollThresholdOut[d],i=o.scrollThresholdIn[d],n<t&&t<i&&(d===0?u=o.scrollStep:d==1?p=o.scrollStep:d==2?u=-o.scrollStep:d==3&&(p=-o.scrollStep));u===0&&p===0||(r.scroll({dx:u,dy:p}),this._scrolling=setTimeout(function(){a.startScroll(e)},o.scrollRepeatTimeout))},lo.prototype.stopScroll=function(){clearTimeout(this._scrolling)},lo.prototype.setOptions=function(e){this._opts=z({},this._opts,e)},lo.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect(),n=gr(e.originalEvent);return{x:n.x-t.left,y:n.y-t.top}};const s1={__depends__:[ci],__init__:["autoScroll"],autoScroll:["type",lo]};function Xu(e){this._commandStack=e.get("commandStack",!1)}Xu.$inject=["injector"],Xu.prototype.allowed=function(e,t){var n=!0,i=this._commandStack;return i&&(n=i.canExecute(e,t)),n===void 0||n};const qn={__init__:["rules"],rules:["type",Xu]};var Xs=Math.round,l1=Math.max;function Yu(e,t){return function(n,i){var r,o;for(r=0;o=n[r];r++)if(jo(o,i)<=10)return{point:n[r],bendpoint:!0,index:r};return null}(e,t)||function(n,i){var r,o,a=fm(function(u,p){return[["M",u.x,u.y],["m",0,-p],["a",p,p,0,1,1,0,20],["a",p,p,0,1,1,0,-20],["z"]]}(i,10),(r=[],n.forEach(function(u,p){r.push([p===0?"M":"L",u.x,u.y])}),r)),s=a[0],c=a[a.length-1];return s?s!==c?s.segment2!==c.segment2?{point:n[o=l1(s.segment2,c.segment2)-1],bendpoint:!0,index:o}:{point:{x:Xs(s.x+c.x)/2,y:Xs(s.y+c.y)/2},index:s.segment2}:{point:{x:Xs(s.x),y:Xs(s.y)},index:s.segment2}:null}(e,t)}function Av(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Tv(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function Ju(e,t){var n=t[0],i=t[1],r={x:i.x-n.x,y:i.y-n.y},o=function(a,s,c){var u=[{n:a[0]-c[0],lambda:s[0]},{n:a[1]-c[1],lambda:s[1]}];return-(u[0].n*s[0]+u[1].n*s[1])/(u[0].lambda*s[0]+u[1].lambda*s[1])}([n.x,n.y],[r.x,r.y],[e.x,e.y]);return{x:n.x+o*r.x,y:n.y+o*r.y}}function Pv(e,t){var n=Ju(e,t);return Av({x:n.x-e.x,y:n.y-e.y})}function Ys(e,t){return Av({x:e.x-t.x,y:e.y-t.y})}var Rv="djs-bendpoint",Mv="djs-segment-dragger";function Zu(e,t,n){var i=function(r,o){var a,s=gr(o),c=r._container.getBoundingClientRect();a={x:c.left,y:c.top};var u=r.viewbox();return{x:u.x+(s.x-a.x)/u.scale,y:u.y+(s.y-a.y)/u.scale}}(e,n);return Yu(t,i)}function Qu(e,t){var n=ue("g");Pe(n).add(Rv),xe(e,n);var i=ue("circle");ae(i,{cx:0,cy:0,r:4}),Pe(i).add("djs-visual"),xe(n,i);var r=ue("circle");return ae(r,{cx:0,cy:0,r:10}),Pe(r).add("djs-hit"),xe(n,r),t&&Pe(n).add(t),n}function Nv(e,t,n){var i=ue("g"),r=nu(t,n),o=ei(t,n);return xe(e,i),function(a,s,c,u){var p=ue("g");xe(a,p);var d=function(v,g,E){var _=g.x-v.x,b=g.y-v.y;return Iv(E==="h"?_:b)}(s,c,u),m=ue("rect");ae(m,{x:-9,y:-3,width:18,height:6}),Pe(m).add("djs-visual"),xe(p,m);var f=ue("rect");ae(f,{x:-d/2,y:-8.5,width:d,height:17}),Pe(f).add("djs-hit"),xe(p,f),Nm(p,u==="v"?90:0)}(i,t,n,o),Pe(i).add(Mv),Pe(i).add(o==="h"?"horizontal":"vertical"),Et(i,r.x,r.y),i}function Iv(e){return Math.abs(Math.round(2*e/3))}function Bv(e,t,n,i,r){function o(m,f,v){ve.bind(m,f,function(g){n.triggerMouseEvent(f,g,v),g.stopPropagation()})}function a(m,f){var v=t.getLayer("overlays"),g=Ve('.djs-bendpoints[data-element-id="'+Yo(m.id)+'"]',v);return!g&&f&&(ae(g=ue("g"),{"data-element-id":m.id}),Pe(g).add("djs-bendpoints"),xe(v,g),o(g,"mousedown",m),o(g,"click",m),o(g,"dblclick",m)),g}function s(m,f){return Ve('.djs-segment-dragger[data-segment-idx="'+m+'"]',f)}function c(m,f){f.waypoints.forEach(function(v,g){var E=Qu(m);xe(m,E),Et(E,v.x,v.y)}),Qu(m,"floating")}function u(m,f){for(var v,g,E,_=f.waypoints,b=1;b<_.length;b++)ei(v=_[b-1],g=_[b])&&(ae(E=Nv(m,v,g),{"data-segment-idx":b}),o(E,"mousemove",f))}function p(m){var f=a(m);return f||(c(f=a(m,!0),m),u(f,m)),f}function d(m){var f=a(m);f&&(function(v){$(Wc("."+Mv,v),function(g){dt(g)})}(f),function(v){$(Wc("."+Rv,v),function(g){dt(g)})}(f),u(f,m),c(f,m))}e.on("connection.changed",function(m){d(m.element)}),e.on("connection.remove",function(m){var f=a(m.element);f&&dt(f)}),e.on("element.marker.update",function(m){var f,v=m.element;v.waypoints&&(f=p(v),m.add?Pe(f).add(m.marker):Pe(f).remove(m.marker))}),e.on("element.mousemove",function(m){var f,v,g=m.element,E=g.waypoints;if(E){if(f=a(g,!0),!(v=Zu(t,E,m.originalEvent)))return;(function(_,b){var w=Ve(".floating",_),S=b.point;w&&Et(w,S.x,S.y)})(f,v),v.bendpoint||function(_,b,w){var S,k,l=s(b.index,_),h=w[b.index-1],y=w[b.index],x=b.point,C=nu(h,y),N=ei(h,y);l&&(S=function(O){return Ve(".djs-visual",O)}(l),k={x:x.x-C.x,y:x.y-C.y},N==="v"&&(k={x:k.y,y:k.x}),Et(S,k.x,k.y))}(f,v,E)}}),e.on("element.mousedown",function(m){if(Ii(m)){var f=m.originalEvent,v=m.element;if(v.waypoints)return function(g,E){var _,b=E.waypoints,w=Zu(t,b,g);if(w)return _=function(S,k){var l,h,y=S.waypoints;return k.index<=0||k.bendpoint?null:(h=ei((l={start:y[k.index-1],end:y[k.index]}).start,l.end))?Iv(h==="h"?l.end.x-l.start.x:l.end.y-l.start.y)/2:null}(E,w),function(S,k,l){var h,y,x,C,N,O,B=S.index,H=S.point;return!(B<=0||S.bendpoint)&&(x=nu(h=k[B-1],y=k[B]),C=ei(h,y),N=Math.abs(H.x-x.x),O=Math.abs(H.y-x.y),C&&N<=l&&O<=l)}(w,b,_)?r.start(g,E,w.index):i.start(g,E,w.index,!w.bendpoint),!0}(f,v)}}),e.on("selection.changed",function(m){var f=m.newSelection[0];f&&f.waypoints&&p(f)}),e.on("element.hover",function(m){var f=m.element;f.waypoints&&(p(f),n.registerEvent(m.gfx,"mousemove","element.mousemove"))}),e.on("element.out",function(m){n.unregisterEvent(m.gfx,"mousemove","element.mousemove")}),e.on("element.updateId",function(m){var f=m.element,v=m.newId;if(f.waypoints){var g=a(f);g&&ae(g,{"data-element-id":v})}}),this.addHandles=p,this.updateHandles=d,this.getBendpointsContainer=a,this.getSegmentDragger=s}Bv.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];var Dv=Math.round,_r="reconnectStart",Er="reconnectEnd",aa="updateWaypoints";function ep(e,t,n,i,r,o){this._injector=e,this.start=function(a,s,c,u){var p,d=n.getGraphics(s),m=s.source,f=s.target,v=s.waypoints,g=(p=u||c!==0?u||c!==v.length-1?aa:Er:_r)===aa?"connection.updateWaypoints":"connection.reconnect",E=r.allowed(g,{connection:s,source:m,target:f});E===!1&&(E=r.allowed(g,{connection:s,source:f,target:m})),E!==!1&&i.init(a,"bendpoint.move",{data:{connection:s,connectionGfx:d,context:{allowed:E,bendpointIndex:c,connection:s,source:m,target:f,insert:u,type:p}}})},t.on("bendpoint.move.hover",function(a){var s,c=a.context,u=c.connection,p=u.source,d=u.target,m=a.hover,f=c.type;if(c.hover=m,m){var v=f===aa?"connection.updateWaypoints":"connection.reconnect";if(s=c.allowed=r.allowed(v,{connection:u,source:f===_r?m:p,target:f===Er?m:d}))return c.source=f===_r?m:p,void(c.target=f===Er?m:d);s===!1&&(s=c.allowed=r.allowed(v,{connection:u,source:f===Er?m:d,target:f===_r?m:p})),s&&(c.source=f===Er?m:d,c.target=f===_r?m:p)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(a){var s=a.context,c=s.type;s.hover=null,s.source=null,s.target=null,c!==aa&&(s.allowed=!1)}),t.on("bendpoint.move.end",function(a){var s=a.context,c=s.allowed,u=s.bendpointIndex,p=s.connection,d=s.insert,m=p.waypoints.slice(),f=s.source,v=s.target,g=s.type,E=s.hints||{},_={x:Dv(a.x),y:Dv(a.y)};if(!c)return!1;g===aa?(d?m.splice(u,0,_):m[u]=_,E.bendpointMove={insert:d,bendpointIndex:u},m=this.cropWaypoints(p,m),o.updateWaypoints(p,function(b){b=b.slice();for(var w,S,k,l=0;b[l];)w=b[l],S=b[l-1],jo(w,k=b[l+1])===0||tu(S,k,w)?b.splice(l,1):l++;return b}(m),E)):(g===_r?(E.docking="source",Js(s)&&(E.docking="target",E.newWaypoints=m.reverse())):g===Er&&(E.docking="target",Js(s)&&(E.docking="source",E.newWaypoints=m.reverse())),o.reconnect(p,f,v,_,E))},this)}function Js(e){var t=e.hover,n=e.source,i=e.target,r=e.type;return r===_r?t&&i&&t===i&&n!==i:r===Er?t&&n&&t===n&&n!==i:void 0}ep.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],ep.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 Ov="updateWaypoints",sa="connect-ok",Zs="connect-not-ok",Lv="connect-hover",jv="djs-updating",Vv="djs-dragging";function $v(e,t,n,i){this._injector=t;var r=t.get("connectionPreview",!1);n.on("bendpoint.move.start",function(o){var a=o.context,s=a.bendpointIndex,c=a.connection,u=a.insert,p=c.waypoints,d=p.slice();a.waypoints=p,u&&d.splice(s,0,{x:o.x,y:o.y}),c.waypoints=d,Pe(a.draggerGfx=Qu(i.getLayer("overlays"))).add("djs-dragging"),i.addMarker(c,Vv),i.addMarker(c,jv)}),n.on("bendpoint.move.hover",function(o){var a=o.context,s=a.allowed,c=a.hover,u=a.type;if(c){if(i.addMarker(c,Lv),u===Ov)return;s?(i.removeMarker(c,Zs),i.addMarker(c,sa)):s===!1&&(i.removeMarker(c,sa),i.addMarker(c,Zs))}}),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],1100,function(o){var a=o.context,s=a.hover,c=a.target;s&&(i.removeMarker(s,Lv),i.removeMarker(s,c?sa:Zs))}),n.on("bendpoint.move.move",function(o){var a=o.context,s=a.allowed,c=a.bendpointIndex,u=a.draggerGfx,p=a.hover,d=a.type,m=a.connection,f=m.source,v=m.target,g=m.waypoints.slice(),E={x:o.x,y:o.y},_=a.hints||{},b={};r&&(_.connectionStart&&(b.connectionStart=_.connectionStart),_.connectionEnd&&(b.connectionEnd=_.connectionEnd),d==="reconnectStart"?Js(a)?(b.connectionEnd=b.connectionEnd||E,b.source=v,b.target=p||f,g=g.reverse()):(b.connectionStart=b.connectionStart||E,b.source=p||f,b.target=v):d==="reconnectEnd"?Js(a)?(b.connectionStart=b.connectionStart||E,b.source=p||v,b.target=f,g=g.reverse()):(b.connectionEnd=b.connectionEnd||E,b.source=f,b.target=p||v):(b.noCropping=!0,b.noLayout=!0,g[c]=E),d===Ov&&(g=e.cropWaypoints(m,g)),b.waypoints=g,r.drawPreview(a,s,b)),Et(u,o.x,o.y)},this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],1100,function(o){var a=o.context,s=a.connection,c=a.draggerGfx,u=a.hover,p=a.target,d=a.waypoints;s.waypoints=d,dt(c),i.removeMarker(s,jv),i.removeMarker(s,Vv),u&&(i.removeMarker(u,sa),i.removeMarker(u,p?sa:Zs)),r&&r.cleanUp(a)})}$v.$inject=["bendpointMove","injector","eventBus","canvas"];var Fv="connect-hover",zv="djs-updating";function Uv(e,t,n){return tp(e,t,e[t]+n)}function tp(e,t,n){return{x:t==="x"?n:e.x,y:t==="y"?n:e.y}}function Hv(e){return e==="x"?"y":"x"}function Gv(e,t,n){var i,r;return e.original?e.original:(i=ge(t),tp(e,r=Hv(n),i[r]))}function Wv(e,t,n,i,r,o){var a=e.get("connectionDocking",!1);function s(u,p){if(!a)return p;var d,m=u.waypoints;return u.waypoints=p,d=a.getCroppedWaypoints(u),u.waypoints=m,d}function c(u){r.update("connection",u.connection,u.connectionGfx)}this.start=function(u,p,d){var m,f,v,g,E=n.getGraphics(p),_=d-1,b=d,w=p.waypoints,S=w[_],k=w[b],l=Zu(n,w,u);(f=ei(S,k))&&(v=f==="v"?"x":"y",_===0&&(S=Gv(S,p.source,v)),b===w.length-1&&(k=Gv(k,p.target,v)),m={connection:p,segmentStartIndex:_,segmentEndIndex:b,segmentStart:S,segmentEnd:k,axis:v,dragPosition:g=l?l.point:{x:(S.x+k.x)/2,y:(S.y+k.y)/2}},i.init(u,g,"connectionSegment.move",{cursor:v==="x"?"resize-ew":"resize-ns",data:{connection:p,connectionGfx:E,context:m}}))},t.on("connectionSegment.move.start",function(u){var p=u.context,d=u.connection,m=n.getLayer("overlays");p.originalWaypoints=d.waypoints.slice(),p.draggerGfx=Nv(m,p.segmentStart,p.segmentEnd),Pe(p.draggerGfx).add("djs-dragging"),n.addMarker(d,zv)}),t.on("connectionSegment.move.move",function(u){var p,d,m=u.context,f=m.connection,v=m.segmentStartIndex,g=m.segmentEndIndex,E=m.segmentStart,_=m.segmentEnd,b=m.axis,w=m.originalWaypoints.slice(),S=Uv(E,b,u["d"+b]),k=Uv(_,b,u["d"+b]),l=w.length,h=0;w[v]=S,w[g]=k,v<2&&(p=Tt(f.source,S),v===1?p==="intersect"&&(w.shift(),w[0]=S,h--):p!=="intersect"&&(w.unshift(E),h++)),g>l-3&&(d=Tt(f.target,k),g===l-2?d==="intersect"&&(w.pop(),w[w.length-1]=k):d!=="intersect"&&w.push(_)),m.newWaypoints=f.waypoints=s(f,w),function(y,x,C){var N,O,B,H,q,U,V=y.newWaypoints,te=(N=C,O=V[y.segmentStartIndex+x],B=V[y.segmentEndIndex+x],H=Hv(y.axis),q=Math.max(O[H],B[H]),U=Math.min(O[H],B[H]),tp(O,H,Math.min(Math.max(U+20,N[H]),q-20)));Et(y.draggerGfx,te.x,te.y)}(m,h,u),m.newSegmentStartIndex=v+h,c(u)}),t.on("connectionSegment.move.hover",function(u){u.context.hover=u.hover,n.addMarker(u.hover,Fv)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(u){var p=u.context.hover;p&&n.removeMarker(p,Fv)}),t.on("connectionSegment.move.cleanup",function(u){var p=u.context,d=p.connection;p.draggerGfx&&dt(p.draggerGfx),n.removeMarker(d,zv)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(u){var p=u.context;p.connection.waypoints=p.originalWaypoints,c(u)}),t.on("connectionSegment.move.end",function(u){var p=u.context,d=p.connection,m=p.newWaypoints,f=p.newSegmentStartIndex,v=function(b,w){var S=0,k=b.filter(function(l,h){return!tu(b[h-1],b[h+1],l)||(S=h<=w?S-1:S,!1)});return{waypoints:k,segmentOffset:S}}(m=m.map(function(b){return{original:b.original,x:Math.round(b.x),y:Math.round(b.y)}}),f),g=s(d,v.waypoints),E=v.segmentOffset,_={segmentMove:{segmentStartIndex:p.segmentStartIndex,newSegmentStartIndex:f+E}};o.updateWaypoints(d,g,_)})}Wv.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var c1=Math.abs,qv=Math.round;function Kv(e){return{x:e.x,y:e.y}}function Xv(e){return{x:e.x+e.width,y:e.y+e.height}}function fn(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:qv(e.x+e.width/2),y:qv(e.y+e.height/2)}}function co(e,t){var n=e.snapped;return!!n&&(typeof t=="string"?n[t]:n.x&&n.y)}function ct(e,t,n){if(typeof t!="string")throw new Error("axis must be in [x, y]");if(typeof n!="number"&&n!==!1)throw new Error("value must be Number or false");var i,r=e[t],o=e.snapped=e.snapped||{};return n===!1?o[t]=!1:(o[t]=!0,i=n-r,e[t]+=i,e["d"+t]+=i),r}function Yv(e){return e.children||[]}var u1=Math.abs,Jv=Math.round;function Zv(e){function t(i,r){if(Ee(i)){for(var o=i.length;o--;)if(u1(i[o]-r)<=10)return i[o]}else{var a=r%(i=+i);if(a<10)return r-a;if(a>i-10)return r-a+i}return r}function n(i,r){return i.waypoints?(a=function(s,c){for(var u,p=c.waypoints,d=1/0,m=0;m<p.length-1;m++){var f=Pv(s,[p[m],p[m+1]]);f<d&&(d=f,u=m)}return[p[u],p[u+1]]}(o=r,i),Ju(o,a)):i.width?{x:Jv(i.width/2+i.x),y:Jv(i.height/2+i.y)}:void 0;var o,a}e.on("connectionSegment.move.move",1500,function(i){var r,o,a=function(d){var m=d.context,f=m.snapPoints,v=m.connection,g=v.waypoints,E=m.segmentStart,_=m.segmentStartIndex,b=m.segmentEnd,w=m.segmentEndIndex,S=m.axis;if(f)return f;var k=[g[_-1],E,b,g[w+1]];return _<2&&k.unshift(n(v.source,d)),w>g.length-3&&k.unshift(n(v.target,d)),m.snapPoints=f={horizontal:[],vertical:[]},$(k,function(l){l&&(l=l.original||l,S==="y"&&f.horizontal.push(l.y),S==="x"&&f.vertical.push(l.x))}),f}(i),s=i.x,c=i.y;if(a){var u=s-(r=t(a.vertical,s)),p=c-(o=t(a.horizontal,c));z(i,{dx:i.dx-u,dy:i.dy-p,x:r,y:o}),(u||a.vertical.indexOf(s)!==-1)&&ct(i,"x",r),(p||a.horizontal.indexOf(c)!==-1)&&ct(i,"y",o)}}),e.on(["connect.hover","connect.move","connect.end"],1500,function(i){var r=i.context.hover,o=r&&n(r,i);Fe(r)&&o&&o.x&&o.y&&(ct(i,"x",o.x),ct(i,"y",o.y))}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(i){var r,o,a=i.context,s=function(v){var g=v.snapPoints,E=v.connection.waypoints,_=v.bendpointIndex;if(g)return g;var b=[E[_-1],E[_+1]];return v.snapPoints=g={horizontal:[],vertical:[]},$(b,function(w){w&&(w=w.original||w,g.horizontal.push(w.y),g.vertical.push(w.x))}),g}(a),c=a.hover,u=c&&n(c,i),p=i.x,d=i.y;if(s){var m=p-(r=t(u?s.vertical.concat([u.x]):s.vertical,p)),f=d-(o=t(u?s.horizontal.concat([u.y]):s.horizontal,d));z(i,{dx:i.dx-m,dy:i.dy-f,x:i.x-m,y:i.y-f}),(m||s.vertical.indexOf(p)!==-1)&&ct(i,"x",r),(f||s.horizontal.indexOf(d)!==-1)&&ct(i,"y",o)}})}Zv.$inject=["eventBus"];const p1={__depends__:[ci,qn],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",Bv],bendpointMove:["type",ep],bendpointMovePreview:["type",$v],connectionSegmentMove:["type",Wv],bendpointSnapping:["type",Zv]};function Qv(e,t,n,i){function r(o,a){return i.allowed("connection.create",{source:o,target:a})}e.on("connect.hover",function(o){var a,s=o.context,c=s.start,u=o.hover;if(s.hover=u,!Io(a=s.canExecute=r(c,u))){if(a!==!1)return s.source=c,void(s.target=u);Io(a=s.canExecute=r(u,c))||a!==!1&&(s.source=u,s.target=c)}}),e.on(["connect.out","connect.cleanup"],function(o){var a=o.context;a.hover=null,a.source=null,a.target=null,a.canExecute=!1}),e.on("connect.end",function(o){var a=o.context,s=a.canExecute,c=a.connectionStart,u={x:o.x,y:o.y},p=a.source,d=a.target;if(!s)return!1;var m=null,f={connectionStart:np(a)?u:c,connectionEnd:np(a)?c:u};vt(s)&&(m=s),a.connection=n.connect(p,d,m,f)}),this.start=function(o,a,s,c){vt(s)||(c=s,s=ge(a)),t.init(o,"connect",{autoActivate:c,data:{shape:a,context:{start:a,connectionStart:s}}})}}function np(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}Qv.$inject=["eventBus","dragging","modeling","rules"];var ey="connect-ok",ty="connect-not-ok";function ny(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",function(r){var o=r.context,a=o.canExecute,s=o.hover,c=o.source,u=o.start,p=o.startPosition,d=o.target,m=o.connectionStart||p,f=o.connectionEnd||{x:r.x,y:r.y},v=m,g=f;np(o)&&(v=f,g=m),i.drawPreview(o,a,{source:c||u,target:d||s,connectionStart:v,connectionEnd:g})}),t.on("connect.hover",900,function(r){var o=r.context,a=r.hover,s=o.canExecute;s!==null&&n.addMarker(a,s?ey:ty)}),t.on(["connect.out","connect.cleanup"],1100,function(r){var o=r.hover;o&&(n.removeMarker(o,ey),n.removeMarker(o,ty))}),i&&t.on("connect.cleanup",function(r){i.cleanUp(r.context)})}ny.$inject=["injector","eventBus","canvas"];const ip={__depends__:[Gn,qn,ci],__init__:["connectPreview"],connect:["type",Qv],connectPreview:["type",ny]};function ui(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)}ui.$inject=["injector","canvas","graphicsFactory","elementFactory"],ui.prototype.drawPreview=function(e,t,n){n=n||{};var i,r=e.connectionPreviewGfx,o=e.getConnection,a=n.source,s=n.target,c=n.waypoints,u=n.connectionStart,p=n.connectionEnd,d=n.noLayout,m=n.noCropping,f=n.noNoop,v=this;r||(r=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),rs(r),o||(o=e.getConnection=function(g){var E={};return function(_){var b=JSON.stringify(_),w=E[b];return w||(w=E[b]=g.apply(null,arguments)),w}}(function(g,E,_){return v.getConnection(g,E,_)})),t&&(i=o(t,a,s)),i?(i.waypoints=c||[],this._layouter&&!d&&(i.waypoints=this._layouter.layoutConnection(i,{source:a,target:s,connectionStart:u,connectionEnd:p,waypoints:n.waypoints||i.waypoints})),i.waypoints&&i.waypoints.length||(i.waypoints=[a?ge(a):u,s?ge(s):p]),this._connectionDocking&&(a||s)&&!m&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,a,s)),this._graphicsFactory.drawConnection(r,i,{stroke:"var(--element-dragger-color)"})):!f&&this.drawNoopPreview(r,n)},ui.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||ge(n),o=t.connectionEnd||ge(i),a=this.cropWaypoints(r,o,n,i);xe(e,this.createNoopConnection(a[0],a[1]))},ui.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&&ou(o,s,!0)||e,t=i&&ou(a,s,!1)||t]},ui.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&dt(e.connectionPreviewGfx)},ui.prototype.getConnection=function(e){var t=function(n){return vt(n)?n:{}}(e);return this._elementFactory.createConnection(t)},ui.prototype.createConnectionPreviewGfx=function(){var e=ue("g");return ae(e,{pointerEvents:"none"}),Pe(e).add("djs-dragger"),xe(this._canvas.getActiveLayer(),e),e},ui.prototype.createNoopConnection=function(e,t){return ss([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};const d1={__init__:["connectionPreview"],connectionPreview:["type",ui]},h1=new Xo("ps");var m1=["marker-start","marker-mid","marker-end"],f1=["circle","ellipse","line","path","polygon","polyline","path","rect"];function Di(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i}Di.$inject=["elementRegistry","eventBus","canvas","styles"],Di.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")},Di.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},Di.prototype.addDragger=function(e,t,n,i="djs-dragger"){var r=Kh(n=n||this.getGfx(e)),o=n.getBoundingClientRect();return this._cloneMarkers(cr(r),i),ae(r,this._styles.cls(i,[],{x:o.top,y:o.left})),xe(t,r),ae(r,"data-preview-support-element-id",e.id),r},Di.prototype.addFrame=function(e,t){var n=ue("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return xe(t,n),ae(n,"data-preview-support-element-id",e.id),n},Di.prototype._cloneMarkers=function(e,t="djs-dragger",n=e){var i=this;if(e.childNodes)for(var r=0;r<e.childNodes.length;r++)i._cloneMarkers(e.childNodes[r],t,n);(function(o){return f1.indexOf(o.nodeName)!==-1})(e)&&m1.forEach(function(o){if(ae(e,o)){var a=function(s,c,u){return Ve("marker#"+ae(s,c).match(/url\(['"]?#([^'"]*)['"]?\)/)[1],u||document)}(e,o,i._canvas.getContainer());a&&i._cloneMarker(n,e,a,o,t)}})},Di.prototype._cloneMarker=function(e,t,n,i,r="djs-dragger"){var o=[n.id,r,h1.next()].join("-"),a=Ve("marker#"+n.id,e);e=e||this._canvas._svg;var s=a||Kh(n);s.id=o,Pe(s).add(r);var c=Ve(":scope > defs",e);c||xe(e,c=ue("defs")),xe(c,s),ae(t,i,"url(#"+s.id+")")};const uo={__init__:["previewSupport"],previewSupport:["type",Di]},Qs="complex-preview";class iy{constructor(t,n,i){this._canvas=t,this._graphicsFactory=n,this._previewSupport=i,this._markers=[]}create(t){this.cleanUp();const{created:n=[],moved:i=[],removed:r=[],resized:o=[]}=t,a=this._canvas.getLayer(Qs);n.filter(s=>!function(c){return c.hidden}(s)).forEach(s=>{let c;Fe(s)?(c=this._graphicsFactory._createContainer("connection",ue("g")),this._graphicsFactory.drawConnection(cr(c),s)):(c=this._graphicsFactory._createContainer("shape",ue("g")),this._graphicsFactory.drawShape(cr(c),s),Et(c,s.x,s.y)),this._previewSupport.addDragger(s,a,c)}),i.forEach(({element:s,delta:c})=>{this._previewSupport.addDragger(s,a,void 0,"djs-dragging"),this._canvas.addMarker(s,"djs-element-hidden"),this._markers.push([s,"djs-element-hidden"]);const u=this._previewSupport.addDragger(s,a);Fe(s)?Et(u,c.x,c.y):Et(u,s.x+c.x,s.y+c.y)}),r.forEach(s=>{this._previewSupport.addDragger(s,a,void 0,"djs-dragging"),this._canvas.addMarker(s,"djs-element-hidden"),this._markers.push([s,"djs-element-hidden"])}),o.forEach(({shape:s,bounds:c})=>{this._canvas.addMarker(s,"djs-hidden"),this._markers.push([s,"djs-hidden"]),this._previewSupport.addDragger(s,a,void 0,"djs-dragging");const u=this._graphicsFactory._createContainer("shape",ue("g"));this._graphicsFactory.drawShape(cr(u),s,{width:c.width,height:c.height}),Et(u,c.x,c.y),this._previewSupport.addDragger(s,a,u)})}cleanUp(){rs(this._canvas.getLayer(Qs)),this._markers.forEach(([t,n])=>this._canvas.removeMarker(t,n)),this._markers=[]}show(){this._canvas.showLayer(Qs)}hide(){this._canvas.hideLayer(Qs)}}iy.$inject=["canvas","graphicsFactory","previewSupport"];const v1={__depends__:[uo],__init__:["complexPreview"],complexPreview:["type",iy]};var rp=["top","bottom","left","right"];function op(e,t){function n(i){if(ws(i)){var r=function(o){var a=ge(o.label),s=ry(ge(o),a);if(c=s,rp.indexOf(c)!==-1){var c,u=function(m){var f=ge(m),v=[].concat(m.incoming.map(function(g){return g.waypoints[g.waypoints.length-2]}),m.outgoing.map(function(g){return g.waypoints[1]})).map(function(g){return ry(f,g)});return v}(o);if(o.host){var p=function(m){var f,v=m.host,g=Tt(ge(m),v);return f=g.indexOf("-")>=0?g.split("-"):[g],rp.filter(function(E){return f.indexOf(E)===-1})}(o);u=u.concat(p)}var d=rp.filter(function(m){return u.indexOf(m)===-1});if(d.indexOf(s)===-1)return d[0]}}(i);r&&function(o,a){var s=ge(o),c=o.label,u=ge(c);if(c.parent){var p,d=de(o);switch(a){case"top":p={x:s.x,y:d.top-10-c.height/2};break;case"left":p={x:d.left-10-c.width/2,y:s.y};break;case"bottom":p={x:s.x,y:d.bottom+10+c.height/2};break;case"right":p={x:d.right+10+c.width/2,y:s.y}}var m=Rn(p,u);t.moveShape(c,m)}}(i,r)}}Z.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(i){var r=i.context,o=r.connection,a=o.source,s=o.target;(r.hints||{}).createElementsBehavior!==!1&&(n(a),n(s))}),this.postExecuted(["label.create"],function(i){var r=i.context,o=r.shape;(r.hints||{}).createElementsBehavior!==!1&&n(o.labelTarget)}),this.postExecuted(["elements.create"],function(i){var r=i.context,o=r.elements;(r.hints||{}).createElementsBehavior!==!1&&o.forEach(function(a){n(a)})})}function ry(e,t){return Tt(t,e,5)}function ap(e){Z.call(this,e),this.preExecute("shape.append",function(t){var n=t.source,i=t.shape;t.position||(P(i,"bpmn:TextAnnotation")?t.position={x:n.x+n.width/2+75,y:n.y-50-i.height/2}:t.position={x:n.x+n.width+80+i.width/2,y:n.y+n.height/2})},!0)}function sp(e,t){e.invoke(Z,this),this.postExecute("shape.move",function(n){var i=n.newParent,r=n.shape;$(Ce(r.incoming.concat(r.outgoing),function(o){return P(o,"bpmn:Association")}),function(o){t.moveConnection(o,{x:0,y:0},i)})},!0)}function el(e,t){t.invoke(Z,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;(r=r.filter(function(o){return oy(o,o.host)})).length===1&&r.map(function(o){return r.indexOf(o)}).forEach(function(o){var a=r[o];i.elements[o]=n._replaceShape(r[o],a)})},!0),this.preExecute("elements.move",500,function(i){var r=i.shapes,o=i.newHost;if(r.length===1){var a=r[0];oy(a,o)&&(i.shapes=[n._replaceShape(a,o)])}},!0)}function oy(e,t){return!Re(e)&&Se(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function lp(e,t){function n(i){return Ce(i.attachers,function(r){return P(r,"bpmn:BoundaryEvent")})}Z.call(this,e),this.postExecute("connection.create",function(i){var r=i.context.source,o=i.context.target,a=n(o);P(r,"bpmn:EventBasedGateway")&&P(o,"bpmn:ReceiveTask")&&a.length>0&&t.removeElements(a)}),this.postExecute("connection.reconnect",function(i){var r=i.context.oldSource,o=i.context.newSource;P(r,"bpmn:Gateway")&&P(o,"bpmn:EventBasedGateway")&&$(o.outgoing,function(a){var s=a.target,c=n(s);P(s,"bpmn:ReceiveTask")&&c.length>0&&t.removeElements(c)})})}function cp(e,t,n){function i(o){t.updateProperties(o,{isForCompensation:!0})}function r(o){t.updateProperties(o,{isForCompensation:void 0})}Z.call(this,e),this.preExecute("shape.replace",function(o){const{newData:a,oldShape:s}=o;if(po(o.oldShape)&&a.eventDefinitionType!=="bpmn:CompensateEventDefinition"||a.type!=="bpmn:BoundaryEvent"){const c=s.outgoing.find(({target:u})=>la(u));c&&c.target&&(o._connectionTarget=c.target)}else if(!po(o.oldShape)&&a.eventDefinitionType==="bpmn:CompensateEventDefinition"&&a.type==="bpmn:BoundaryEvent"){const c=s.outgoing.find(({target:u})=>tl(u));c&&c.target&&(o._connectionTarget=c.target),function(u){const p=u.outgoing.filter(d=>P(d,"bpmn:SequenceFlow"));t.removeElements(p)}(s)}},!0),this.postExecuted("shape.replace",function(o){const{_connectionTarget:a,newShape:s}=o;a&&t.connect(s,a)},!0),this.preExecute("connection.create",function(o){const a=o.connection,s=o.source,c=o.target;po(s)&&tl(c)&&(i(c),function(u,p){u.outgoing.filter(m=>P(m,"bpmn:Association")).filter(m=>la(m.target)&&!p.includes(m)).forEach(m=>t.removeConnection(m))}(s,[a]))},!0),this.postExecuted("connection.delete",function(o){const a=o.source,s=o.target;po(a)&&la(s)&&r(s)},!0),this.postExecuted("connection.reconnect",function(o){const a=o.newTarget,s=o.oldSource,c=o.oldTarget;if(c!==a){const u=s;la(c)&&r(c),po(u)&&tl(a)&&i(a)}},!0),this.postExecuted("element.updateProperties",function(o){const{element:a}=o;la(a)?(function(s){for(const c of s.incoming)n.canConnect(c.source,s)||t.removeConnection(c);for(const c of s.outgoing)n.canConnect(s,c.target)||t.removeConnection(c)}(a),function(s){const c=s.attachers.slice();c.length&&t.removeElements(c)}(a)):tl(a)&&function(s){const c=s.incoming.filter(u=>po(u.source));t.removeElements(c)}(a)},!0)}function la(e){const t=Q(e);return t&&t.get("isForCompensation")}function po(e){return e&&P(e,"bpmn:BoundaryEvent")&&Xr(e,"bpmn:CompensateEventDefinition")}function tl(e){return e&&P(e,"bpmn:Activity")&&!wt(e)}function up(e){e.invoke(Z,this),this.preExecute("shape.create",1500,function(t){var n=t.context,i=n.parent,r=n.shape;P(i,"bpmn:Lane")&&!P(r,"bpmn:Lane")&&(n.parent=ao(i,"bpmn:Participant"))})}function pp(e,t){Z.call(this,e),this.preExecute("shape.create",function(n){var i=n.context.shape;if(P(i,"bpmn:DataObjectReference")&&i.type!=="label"){var r=t.create("bpmn:DataObject");i.businessObject.dataObjectRef=r}})}le(op,Z),op.$inject=["eventBus","modeling"],le(ap,Z),ap.$inject=["eventBus"],le(sp,Z),sp.$inject=["injector","modeling"],el.$inject=["bpmnReplace","injector"],le(el,Z),el.prototype._replaceShape=function(e,t){var n,i=(n=Q(e).eventDefinitions)&&n[0],r={type:"bpmn:BoundaryEvent",host:t};return i&&(r.eventDefinitionType=i.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})},lp.$inject=["eventBus","modeling"],le(lp,Z),le(cp,Z),cp.$inject=["eventBus","modeling","bpmnRules"],up.$inject=["injector"],le(up,Z),pp.$inject=["eventBus","bpmnFactory"],le(pp,Z);var nl=2e3;function dp(e,t,n){function i(){var r=e.getRootElement();return P(r,"bpmn:Collaboration")?r:n.makeCollaboration()}Z.call(this,t),t.on(["create.start","shape.move.start"],nl,function(r){var o=r.context,a=o.shape,s=e.getRootElement();if(P(a,"bpmn:Participant")&&P(s,"bpmn:Process")&&s.children.length){var c=s.children.filter(function(d){return!P(d,"bpmn:Group")&&!Re(d)&&!Fe(d)});if(c.length){var u=yt(c),p=function(d,m){m={width:m.width+40+30,height:m.height+40};var f=Math.max(d.width,m.width),v=Math.max(d.height,m.height);return{x:-f/2,y:-v/2,width:f,height:v}}(a,u);z(a,p),o.createConstraints=function(d,m){return{bottom:(m=de(m)).top+d.height/2-20,left:m.right-d.width/2+20,top:m.bottom-d.height/2+20,right:m.left+d.width/2-20-30}}(a,u)}}}),t.on("create.start",nl,function(r){var o=r.context.shape,a=e.getRootElement(),s=e.getGraphics(a);function c(u){u.element=a,u.gfx=s}P(o,"bpmn:Participant")&&P(a,"bpmn:Process")&&(t.on("element.hover",nl,c),t.once("create.cleanup",function(){t.off("element.hover",c)}))}),this.preExecute("elements.create",nl,function(r){var o,a=r.elements,s=r.parent,c=function(u){return Be(u,function(p){return P(p,"bpmn:Participant")})}(a);c&&P(s,"bpmn:Process")&&(r.parent=i(),(o=r.hints=r.hints||{}).participant=c,o.process=s,o.processRef=Q(c).get("processRef"))},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;P(a,"bpmn:Participant")&&P(o,"bpmn:Process")&&(r.parent=i(),r.process=o,r.processRef=Q(a).get("processRef"))},!0),this.execute("shape.create",function(r){var o=r.hints||{},a=r.process||o.process,s=r.shape,c=o.participant;!a||c&&s!==c||Q(s).set("processRef",Q(a))},!0),this.revert("shape.create",function(r){var o=r.hints||{},a=r.process||o.process,s=r.processRef||o.processRef,c=r.shape,u=o.participant;!a||u&&c!==u||Q(c).set("processRef",s)},!0),this.postExecute("shape.create",function(r){var o=r.hints||{},a=r.process||r.hints.process,s=r.shape,c=o.participant;if(a){var u=a.children.slice();c?s===c&&n.moveElements(u,{x:0,y:0},c):n.moveElements(u,{x:0,y:0},s)}},!0)}dp.$inject=["canvas","eventBus","modeling"],le(dp,Z);var ay="__targetRef_placeholder";function hp(e,t){function n(o,a){var s=o.get("properties"),c=Be(s,function(u){return u.name===ay});return!c&&a&&ht(s,c=t.create("bpmn:Property",{name:ay})),c}function i(o,a){var s=n(o);s&&(function(c,u,p){return Be(c.get("dataInputAssociations"),function(d){return d!==p&&d.targetRef===u})}(o,s,a)||ot(o.get("properties"),s))}function r(o){var a,s=o.context,c=s.connection,u=c.businessObject,p=c.target,d=p&&p.businessObject,m=s.newTarget,f=m&&m.businessObject,v=s.oldTarget||s.target,g=v&&v.businessObject,E=c.businessObject;g&&g!==d&&i(g,u),f&&f!==d&&i(f,u),d?(a=n(d,!0),E.targetRef=a):E.targetRef=null}Z.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],sy(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],sy(r))}function sy(e){return function(t){if(P(t.context.connection,"bpmn:DataInputAssociation"))return e(t)}}function il(e){this._bpmnUpdater=e}function mp(e,t,n,i){function r(a){return a.children.filter(function(s){return P(s,"bpmn:DataStoreReference")&&!s.labelTarget})}function o(a,s){var c=a.businessObject||a;if(s=s||n.filter(function(p){return P(p,"bpmn:Participant")&&Q(p).processRef})[0]){var u=s.businessObject||s;t.execute("dataStore.updateContainment",{dataStoreBo:c,dataStoreDi:Me(a),newSemanticParent:u.processRef||u,newDiParent:Me(s)})}}Z.call(this,i),t.registerHandler("dataStore.updateContainment",il),this.preExecute("shape.create",function(a){var s=a.context,c=s.shape;P(c,"bpmn:DataStoreReference")&&c.type!=="label"&&(s.hints||(s.hints={}),s.hints.autoResize=!1)}),this.preExecute("elements.move",function(a){var s=a.context,c=s.shapes;c.filter(function(u){return P(u,"bpmn:DataStoreReference")}).length&&(s.hints||(s.hints={}),s.hints.autoResize=c.filter(function(u){return!P(u,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(a){var s=a.context.shape,c=s.parent;P(s,"bpmn:DataStoreReference")&&s.type!=="label"&&P(c,"bpmn:Collaboration")&&o(s)}),this.postExecute("shape.move",function(a){var s=a.context,c=s.shape,u=s.oldParent,p=c.parent;P(u,"bpmn:Collaboration")||P(c,"bpmn:DataStoreReference")&&c.type!=="label"&&P(p,"bpmn:Collaboration")&&o(c,P(u,"bpmn:Participant")?u:function(d){for(;d.parent;){if(P(d.parent,"bpmn:Participant"))return d.parent;d=d.parent}}(u))}),this.postExecute("shape.delete",function(a){var s=a.context.shape,c=e.getRootElement();Se(s,["bpmn:Participant","bpmn:SubProcess"])&&P(c,"bpmn:Collaboration")&&r(c).filter(function(u){return function(p,d){for(var m=p.businessObject||p,f=d.businessObject||d;m.$parent;){if(m.$parent===f.processRef||f)return!0;m=m.$parent}return!1}(u,s)}).forEach(function(u){o(u)})}),this.postExecute("canvas.updateRoot",function(a){var s=a.context,c=s.oldRoot,u=s.newRoot;r(c).forEach(function(p){P(u,"bpmn:Process")&&o(p,u)})})}hp.$inject=["eventBus","bpmnFactory"],le(hp,Z),il.$inject=["bpmnUpdater"],il.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),[]},il.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),[]},mp.$inject=["canvas","commandStack","elementRegistry","eventBus"],le(mp,Z);var rl=Math.max,ol=Math.min;function ly(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function al(e,t,n){var i=t[e],r=n.min&&n.min[e],o=n.max&&n.max[e];return ye(r)&&(i=(/top|left/.test(e)?ol:rl)(i,r)),ye(o)&&(i=(/top|left/.test(e)?rl:ol)(i,o)),i}function ca(e,t){return e!==void 0?e:20}function y1(e){return!e.waypoints&&e.type!=="label"}function cy(e,t){var n;if((n=e.length===void 0?Ce(e.children,y1):e).length)return function(i,r){var o,a,s,c;return typeof r=="object"?(o=ca(r.left),a=ca(r.right),s=ca(r.top),c=ca(r.bottom)):o=a=s=c=ca(r),{x:i.x-o,y:i.y-s,width:i.width+o+a,height:i.height+s+c}}(yt(n),t)}var Oi=Math.abs,g1=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],vn=30;function sl(e,t){return t=t||[],e.children.filter(function(n){P(n,"bpmn:Lane")&&(sl(n,t),t.push(n))}),t}function pi(e){return e.children.filter(function(t){return P(t,"bpmn:Lane")})}function yn(e){return ao(e,g1)||e}function fp(e,t){Z.call(this,e),this.postExecuted("shape.delete",500,function(n){var i=n.context,r=i.hints,o=i.shape,a=i.oldParent;P(o,"bpmn:Lane")&&(r&&r.nested||function(s,c){var u,p,d,m,f,v=gt(s),g=pi(c),E=[],_=[],b=[],w=[];lr(g,function(S){return v?S.y>s.y?_.push(S):E.push(S):S.x>s.x?w.push(S):b.push(S),S.children}),g.length&&(u=v?_.length&&E.length?s.height/2:s.height:w.length&&b.length?s.width/2:s.width,E.length&&(p=t.calculateAdjustments(E,"y",u,s.y-10),t.makeSpace(p.movingShapes,p.resizingShapes,{x:0,y:u},"s")),_.length&&(d=t.calculateAdjustments(_,"y",-u,s.y+s.height+10),t.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:-u},"n")),b.length&&(m=t.calculateAdjustments(b,"x",u,s.x-10),t.makeSpace(m.movingShapes,m.resizingShapes,{x:u,y:0},"e")),w.length&&(f=t.calculateAdjustments(w,"x",-u,s.x+s.width+10),t.makeSpace(f.movingShapes,f.resizingShapes,{x:-u,y:0},"w")))}(o,a))})}function ll(e,t){t.invoke(Z,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;r.filter(function(o){return uy(o,o.host)}).map(function(o){return r.indexOf(o)}).forEach(function(o){i.elements[o]=n._replaceShape(r[o])})},!0),this.preExecute("elements.move",500,function(i){var r=i.shapes,o=i.newHost;r.forEach(function(a,s){var c,u=a.host;uy(a,(c=u,r.indexOf(c)!==-1?u:o))&&(r[s]=n._replaceShape(a))})},!0)}function uy(e,t){return!Re(e)&&P(e,"bpmn:BoundaryEvent")&&!t}function vp(e,t,n){function i(r,o,a){var s,c,u,p,d,m,f,v,g=o.waypoints,E=r.outgoing.slice(),_=r.incoming.slice(),b=Yu(g,v=ye(a.width)?ge(a):a);if(b){if(s=g.slice(0,b.index),c=g.slice(b.index+(b.bendpoint?1:0)),!s.length||!c.length)return;u=b.bendpoint?g[b.index]:v,s.length!==1&&py(r,s[s.length-1])||s.push(dy(u)),c.length!==1&&py(r,c[0])||c.unshift(dy(u))}p=o.source,d=o.target,t.canConnect(p,r,o)&&(n.reconnectEnd(o,r,s||v),m=o),t.canConnect(r,d,o)&&(m?f=n.connect(r,d,{type:o.type,waypoints:c}):(n.reconnectStart(o,r,c||v),f=o));var w=[].concat(m&&Ce(_,function(S){return S.source===m.source})||[],f&&Ce(E,function(S){return S.target===f.target})||[]);w.length&&n.removeElements(w)}Z.call(this,e),this.preExecute("elements.move",function(r){var o=r.newParent,a=r.shapes,s=r.delta,c=a[0];if(c&&o){o&&o.waypoints&&(r.newParent=o=o.parent);var u=ge(c),p={x:u.x+s.x,y:u.y+s.y},d=Be(o.children,function(m){return t.canInsert(a,m)&&Yu(m.waypoints,p)});d&&(r.targetFlow=d,r.position=p)}},!0),this.postExecuted("elements.move",function(r){var o=r.shapes,a=r.targetFlow,s=r.position;a&&i(o[0],a,s)},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;t.canInsert(a,o)&&(r.targetFlow=o,r.parent=o.parent)},!0),this.postExecuted("shape.create",function(r){var o=r.shape,a=r.targetFlow,s=r.position;a&&i(o,a,s)},!0)}function py(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}function dy(e){return z({},e)}function yp(e,t){Z.call(this,e),this.preExecuted("connection.create",function(n){var i=n.context,r=i.connection,o=i.source,a=i.target,s=i.hints;s&&s.createElementsBehavior===!1||!ho(r)||(P(o,"bpmn:EventBasedGateway")?a.incoming.filter(c=>c!==r&&ho(c)):a.incoming.filter(c=>c!==r&&ho(c)&&P(c.source,"bpmn:EventBasedGateway"))).forEach(function(c){t.removeConnection(c)})}),this.preExecuted("shape.replace",function(n){var i=n.context.newShape;P(i,"bpmn:EventBasedGateway")&&i.outgoing.filter(ho).reduce(function(r,o){return r.includes(o.target)?r:r.concat(o.target)},[]).forEach(function(r){r.incoming.filter(ho).forEach(function(o){const a=r.incoming.filter(ho).filter(function(s){return s.source===i});(o.source!==i||a.length>1)&&t.removeConnection(o)})})})}function ho(e){return P(e,"bpmn:SequenceFlow")}fp.$inject=["eventBus","spaceTool"],le(fp,Z),ll.$inject=["bpmnReplace","injector"],le(ll,Z),ll.prototype._replaceShape=function(e){var t,n,i=(n=Q(e).eventDefinitions)&&n[0];return t=i?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:i.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,t,{layoutConnection:!1})},le(vp,Z),vp.$inject=["eventBus","bpmnRules","modeling"],yp.$inject=["eventBus","modeling"],le(yp,Z);var cl=1500;function hy(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"],cl,function(i){var r=i.context.shape||i.shape,o=i.hover;P(o,"bpmn:Lane")&&!Se(r,["bpmn:Lane","bpmn:Participant"])&&(i.hover=yn(o),i.hoverGfx=e.getGraphics(i.hover));var a=n.getRootElement();o!==a&&(r.labelTarget||Se(r,["bpmn:Group","bpmn:TextAnnotation"]))&&(i.hover=a,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],cl,function(i){var r=i.hover;P(r,"bpmn:Lane")&&(i.hover=yn(r)||r,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["bendpoint.move.hover"],cl,function(i){var r=i.context,o=i.hover,a=r.type;P(o,"bpmn:Lane")&&/reconnect/.test(a)&&(i.hover=yn(o)||o,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.start"],cl,function(i){var r=i.context,o=r.start;P(o,"bpmn:Lane")&&(r.start=yn(o)||o)}),t.on("shape.move.start",2e3,function(i){var r=i.shape;P(r,"bpmn:Lane")&&(i.shape=yn(r)||r)}),t.on("spaceTool.move",2e3,function(i){var r=i.hover;r&&P(r,"bpmn:Lane")&&(i.hover=yn(r))})}function gp(e,t,n,i,r,o){function a(d,m,f){var v=n.filter(function(g){return P(g,"bpmn:Group")}).filter(function(g){return g.businessObject!==f});m&&!function(g,E){return g.some(function(_){var b=Q(_);return(b.categoryValueRef&&b.categoryValueRef.$parent)===E})}(v,m)&&function(g){var E=g.$parent;E&&(ot(E.get("rootElements"),g),g.$parent=null)}(m),d&&!function(g,E){return g.some(function(_){return Q(_).categoryValueRef===E})}(v,d)&&function(g){var E=g.$parent;E&&(ot(E.get("categoryValue"),g),g.$parent=null)}(d)}function s(d,m){return function(f,v,g){return ht(v.get("categoryValue"),f),f.$parent=v,ht(g.get("rootElements"),v),v.$parent=g,f}(d,m,t.getDefinitions())}function c(d,m){var f=Q(d),v=f.categoryValueRef;v||(v=f.categoryValueRef=m.categoryValue=m.categoryValue||function(E){return E.create("bpmn:CategoryValue")}(e));var g=v.$parent;g||(g=v.$parent=m.category=m.category||function(E){return E.create("bpmn:Category")}(e)),s(v,g,t.getDefinitions())}function u(d,m){var f=m.category,v=m.categoryValue,g=Q(d);v?(g.categoryValueRef=null,a(v,f,g)):a(null,g.categoryValueRef.$parent,g)}function p(d,m){var f=e.create(d.$type);return o.copyElement(d,f,null,m)}r.invoke(Z,this),this.execute("label.create",function(d){var m=d.context,f=m.labelTarget;P(f,"bpmn:Group")&&c(f,m)}),this.revert("label.create",function(d){var m=d.context,f=m.labelTarget;P(f,"bpmn:Group")&&u(f,m)}),this.execute("shape.delete",function(d){var m=d.context,f=m.shape,v=Q(f);if(P(f,"bpmn:Group")&&!f.labelTarget){var g=m.categoryValue=v.categoryValueRef;g&&(a(g,m.category=g.$parent,v),v.categoryValueRef=null)}}),this.reverted("shape.delete",function(d){var m=d.context,f=m.shape;if(P(f,"bpmn:Group")&&!f.labelTarget){var v=m.category,g=m.categoryValue,E=Q(f);g&&(E.categoryValueRef=g,s(g,v))}}),this.execute("shape.create",function(d){var m=d.context,f=m.shape;P(f,"bpmn:Group")&&!f.labelTarget&&Q(f).categoryValueRef&&c(f,m)}),this.reverted("shape.create",function(d){var m=d.context,f=m.shape;P(f,"bpmn:Group")&&!f.labelTarget&&Q(f).categoryValueRef&&u(f,m)}),i.on("copyPaste.copyElement",770,function(d){var m=d.descriptor,f=d.element;if(P(f,"bpmn:Group")&&!f.labelTarget){var v=Q(f);if(v.categoryValueRef){var g=v.categoryValueRef;m.categoryValue=p(g,!0),g.$parent&&(m.category=p(g.$parent,!0))}}}),i.on("copyPaste.pasteElement",770,function(d){var m=d.descriptor,f=m.businessObject,v=m.categoryValue,g=m.category;v&&(v=f.categoryValueRef=p(v)),g&&(v.$parent=p(g)),delete m.category,delete m.categoryValue})}function bp(e,t,n,i){var r,o,a,s;return(r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y))==0?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 my(e){function t(n,i,r){var o,a={x:r.x,y:r.y-50},s={x:r.x-50,y:r.y},c=bp(n,i,r,a),u=bp(n,i,r,s);o=c&&u?fy(c,r)>fy(u,r)?u:c:c||u,n.original=o}e.on("bpmnElement.added",function(n){var i,r,o=n.element;o.waypoints&&(t((r=(i=o).waypoints)[0],r[1],ge(i.source)),t(r[r.length-1],r[r.length-2],ge(i.target)))})}function fy(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function xp(e){Z.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var i=n.context.shape,r=Q(i),o=Me(i);if(Se(r,t)){var a=o.get("isHorizontal");a===void 0&&(a=!0),o.set("isHorizontal",a)}})}hy.$inject=["elementRegistry","eventBus","canvas"],gp.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"],le(gp,Z),my.$inject=["eventBus"],xp.$inject=["eventBus"],le(xp,Z);var vy=Math.sqrt,yy=Math.min,b1=Math.max,gy=Math.abs;function by(e){return Math.pow(e,2)}function ua(e,t){return vy(by(e.x-t.x)+by(e.y-t.y))}function x1(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,u=(r*a+o*s)/c,p=u*u-(a*a+s*s-i*i)/c;if(p<0&&p>-1e-6&&(p=0),p<0)return[];var d=vy(p),m=-u+d,f=-u-d,v={x:e.x-r*m,y:e.y-o*m};return p===0?[v]:[v,{x:e.x-r*f,y:e.y-o*f}].filter(function(g){return function(E,_,b){return xy(E.x,_.x,b.x)&&xy(E.y,_.y,b.y)}(g,e,t)})}function xy(e,t,n){return e>=yy(t,n)-ul&&e<=b1(t,n)+ul}var ul=.1;function _y(e,t){return gy(e.x-t.x)<=ul&&gy(e.y-t.y)<=ul}function Ey(e,t,n,i){var r=0,o=0,a={point:e,delta:{x:0,y:0}},s=function(B,H){var q,U,V,te,X,oe,ne,I,R,M,L,K,j=0;for(j=0;j<H.length-1;j++){if(_y(q=H[j],U=H[j+1])?oe=[q]:(V=ua(B,q),te=ua(B,U),oe=x1(q,U,B,yy(V,te))),oe.length<1)throw new Error("expected between [1, 2] circle -> line intersections");oe.length===1&&(ne={type:"bendpoint",position:oe[0],segmentIndex:j,bendpointIndex:_y(q,oe[0])?j:j+1}),oe.length===2&&(L=oe[0],K=oe[1],ne={type:"segment",position:X={x:(L.x+K.x)/2,y:(L.y+K.y)/2},segmentIndex:j,relativeLocation:ua(q,X)/ua(q,U)}),I=ua(ne.position,B),(!M||R>I)&&(M=ne,R=I)}return M}(e,n),c=s.segmentIndex,u=function(B,H,q,U){var V=q.segmentIndex,te=H.length-B.length;if(U.segmentMove){var X=U.segmentMove.segmentStartIndex,oe=U.segmentMove.newSegmentStartIndex;return V===X?oe:V>=oe?V+te<oe?oe:V+te:V}if(U.bendpointMove){var ne,I=U.bendpointMove.insert,R=U.bendpointMove.bendpointIndex;return te===0?V:(V>=R&&(ne=I?V+1:V-1),V<R&&(ne=V,I&&q.type!=="bendpoint"&&R-1===V&&wy(H,R)<q.relativeLocation&&ne++),ne)}return te===0?V:U.connectionStart&&V===0?0:U.connectionEnd&&V===B.length-2?H.length-2:Math.floor((H.length-2)/2)}(n,t,s,i);if(u<0||u>t.length-2||u===null)return a;var p,d,m,f,v,g,E=Sy(n,c),_=Sy(t,u),b=s.position,w=(f=b,v=Ys((m=E)[0],m[1]),g=Ys(m[0],f),v===0?0:g/v),S=(p=_,d=Tv(E),Tv(p)-d);if(s.type==="bendpoint"){var k=t.length-n.length,l=s.bendpointIndex,h=n[l];if(t.indexOf(h)!==-1)return a;if(k===0){var y=t[l];return{delta:{x:r=y.x-s.position.x,y:o=y.y-s.position.y},point:{x:e.x+r,y:e.y+o}}}k<0&&l!==0&&l<n.length-1&&(w=wy(n,l))}var x,C,N={x:(_[1].x-_[0].x)*w+_[0].x,y:(_[1].y-_[0].y)*w+_[0].y},O=(x={x:e.x-b.x,y:e.y-b.y},(C=S)?{x:Math.cos(C)*x.x-Math.sin(C)*x.y,y:Math.sin(C)*x.x+Math.cos(C)*x.y}:x);return r=N.x+O.x-e.x,o=N.y+O.y-e.y,{point:Ti(N),delta:Ti({x:r,y:o})}}function wy(e,t){var n=Ys(e[t-1],e[t]);return n/(n+Ys(e[t],e[t+1]))}function Sy(e,t){return[e[t],e[t+1]]}function pa(e,t,n){var i=Zo(t),r=Zo(n),o=Rn(e,i),a=o.x*(n.width/t.width),s=o.y*(n.height/t.height);return Ti({x:r.x+a,y:r.y+s})}function Cy(e,t,n){var i=Zo(e),r=Zo(t),o=Zo(n),a=Rn(e,i),s=Rn(i,r),c=function(f,v,g){var E=de(v),_=de(g);if(function(S,k){return function(l,h){return l.right!==h.right&&l.left!==h.left}(S,k)||function(l,h){return l.top!==h.top&&l.bottom!==h.bottom}(S,k)}(E,_))return null;var b,w=Tt(v,f);if(w==="top")b={x:0,y:_.bottom-E.bottom};else if(w==="bottom")b={x:0,y:_.top-E.top};else if(w==="right")b={x:_.left-E.left,y:0};else{if(w!=="left")return null;b={x:_.right-E.right,y:0}}return Tt(g,{x:f.x+b.x,y:f.y+b.y})!==w?null:b}(i,t,n);if(c)return c;var u=s.x*(n.width/t.width),p=s.y*(n.height/t.height),d=o.x+u,m=o.y+p;return Ti({x:d+a.x-e.x,y:m+a.y-e.y})}var ky="name",Ay="text";function _p(e,t,n,i){function r(o){var a=o.context,s=a.element,c=a.properties;if(ky in c&&t.updateLabel(s,c[ky]),Ay in c&&P(s,"bpmn:TextAnnotation")){var u=i.getTextAnnotationBounds({x:s.x,y:s.y,width:s.width,height:s.height},c[Ay]||"");t.updateLabel(s,c.text,u)}}Z.call(this,e),this.postExecute("element.updateProperties",r),this.postExecute("element.updateModdleProperties",o=>{Q(o.context.element)===o.context.moddleElement&&r(o)}),this.postExecute(["shape.create","connection.create"],function(o){var a=o.context;if((a.hints||{}).createElementsBehavior!==!1){var s=a.shape||a.connection;!Re(s)&&hr(s)&&tn(s)&&t.updateLabel(s,tn(s))}}),this.postExecute("shape.delete",function(o){var a=o.context,s=a.labelTarget,c=a.hints||{};s&&c.unsetLabel!==!1&&t.updateLabel(s,null,null,{removeShape:!1})}),this.postExecute(["connection.layout","connection.updateWaypoints"],function(o){var a=o.context;if((a.hints||{}).labelBehavior!==!1){var s,c=a.connection.label;c&&c.parent&&(s=function(u){var p=u.context,d=p.connection,m=d.label,f=z({},p.hints),v=p.newWaypoints||d.waypoints,g=p.oldWaypoints;return f.startChanged===void 0&&(f.startChanged=!!f.connectionStart),f.endChanged===void 0&&(f.endChanged=!!f.connectionEnd),function(E,_,b,w){return Ey(ge(E),_,b,w).delta}(m,v,g,f)}(o),t.moveShape(c,s))}}),this.postExecute(["shape.replace"],function(o){var a=o.context,s=a.newShape,c=a.oldShape,u=Q(s);u&&hr(u)&&c.label&&s.label&&(s.label.x=c.label.x,s.label.y=c.label.y)}),this.postExecute("shape.resize",function(o){var a,s=o.context,c=s.shape,u=s.newBounds,p=s.oldBounds;if(ws(c)){var d=c.label,m=function(v,g){if(g.length){var E=function(_,b){var w=b.map(function(S){return{line:S,distance:Pv(_,S)}});return $n(w,"distance")[0].line}(v,g);return Ju(v,E)}}(ge(d),[[{x:(a=p).x,y:a.y},{x:a.x+(a.width||0),y:a.y}],[{x:a.x+(a.width||0),y:a.y},{x:a.x+(a.width||0),y:a.y+(a.height||0)}],[{x:a.x,y:a.y+(a.height||0)},{x:a.x+(a.width||0),y:a.y+(a.height||0)}],[{x:a.x,y:a.y},{x:a.x,y:a.y+(a.height||0)}]]),f=function(v,g,E){return Ti(Rn(pa(v,g,E),v))}(m,p,u);t.moveShape(d,f)}})}function Ep(e,t){function n(i,r){var o=i.context,a=o.connection,s=z({},o.hints),c=o.newWaypoints||a.waypoints,u=o.oldWaypoints;return s.startChanged===void 0&&(s.startChanged=!!s.connectionStart),s.endChanged===void 0&&(s.endChanged=!!s.connectionEnd),function(p,d,m,f){return Ey(p,d,m,f).point}(r,c,u,s)}Z.call(this,e),this.postExecute(["connection.layout","connection.updateWaypoints"],function(i){var r=i.context.connection,o=r.outgoing;r.incoming.forEach(function(a){var s=a.waypoints[a.waypoints.length-1],c=n(i,s),u=[].concat(a.waypoints.slice(0,-1),[c]);t.updateWaypoints(a,u)}),o.forEach(function(a){var s=a.waypoints[0],c=n(i,s),u=[].concat([c],a.waypoints.slice(1));t.updateWaypoints(a,u)})}),this.postExecute(["connection.move"],function(i){var r=i.context,o=r.connection,a=o.outgoing,s=o.incoming,c=r.delta;s.forEach(function(u){var p=u.waypoints[u.waypoints.length-1],d={x:p.x+c.x,y:p.y+c.y},m=[].concat(u.waypoints.slice(0,-1),[d]);t.updateWaypoints(u,m)}),a.forEach(function(u){var p=u.waypoints[0],d={x:p.x+c.x,y:p.y+c.y},m=[].concat([d],u.waypoints.slice(1));t.updateWaypoints(u,m)})})}function pl(e,t,n){var i=hl(e),r=Py(i,t),o=i[0];return r.length?r[r.length-1]:pa(o.original||o,n,t)}function dl(e,t,n){var i=hl(e),r=Py(i,t),o=i[i.length-1];return r.length?r[0]:pa(o.original||o,n,t)}function wp(e,t,n){var i=hl(e),r=Ty(t,n),o=i[0];return pa(o.original||o,r,t)}function Sp(e,t,n){var i=hl(e),r=Ty(t,n),o=i[i.length-1];return pa(o.original||o,r,t)}function Ty(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function hl(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function Py(e,t){return Ce(kt(e,_1),function(n){return function(i,r){return Tt(r,i,1)==="intersect"}(n,t)})}function _1(e){return e.original||e}function Cp(e,t){Z.call(this,e),this.postExecute("shape.replace",function(n){var i=n.oldShape,r=n.newShape;if(function(p,d){return P(p,"bpmn:Participant")&&Ae(p)&&P(d,"bpmn:Participant")&&!Ae(d)}(i,r)){var o,a,s,c,u=(a=Oo([o=i],!1),s=[],c=[],a.forEach(function(p){p!==o&&(p.incoming.forEach(function(d){P(d,"bpmn:MessageFlow")&&s.push(d)}),p.outgoing.forEach(function(d){P(d,"bpmn:MessageFlow")&&c.push(d)}))},[]),{incoming:s,outgoing:c});u.incoming.forEach(function(p){var d=dl(p,r,i);t.reconnectEnd(p,r,d)}),u.outgoing.forEach(function(p){var d=pl(p,r,i);t.reconnectStart(p,r,d)})}},!0)}le(_p,Z),_p.$inject=["eventBus","modeling","bpmnFactory","textRenderer"],le(Ep,Z),Ep.$inject=["eventBus","modeling"],Cp.$inject=["eventBus","modeling"],le(Cp,Z);const E1=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function Ry(e){const t=Q(e);if(!(P(t,"bpmn:BoundaryEvent")||P(t,"bpmn:StartEvent")&&wt(t.$parent)))return!1;const n=t.get("eventDefinitions");return!(!n||!n.length)&&E1.some(i=>P(n[0],i))}function My(e){return P(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function kp(e,t){e.invoke(Z,this),this.postExecuted("shape.replace",function(n){const i=n.context.oldShape,r=n.context.newShape,o=n.context.hints;if(!Ry(r))return;const a=My(r);if(o.targetElement&&o.targetElement[a]!==void 0)return;const s=Q(i).get(a);s!==Q(r).get(a)&&t.updateProperties(r,{[a]:s})})}function Ap(e,t){Z.call(this,e),this.preExecute("shape.resize",function(n){var i=n.shape,r=Me(i),o=r&&r.get("label");o&&o.get("bounds")&&t.updateModdleProperties(i,o,{bounds:void 0})},!0)}function Tp(e,t,n){Z.call(this,e),this.preExecute("shape.delete",function(i){var r,o,a,s=i.context.shape;if(s.incoming.length===1&&s.outgoing.length===1){var c=s.incoming[0],u=s.outgoing[0];if(P(c,"bpmn:SequenceFlow")&&P(u,"bpmn:SequenceFlow")&&t.canConnect(c.source,u.target,c)){var p=(r=c.waypoints,o=u.waypoints,(a=bp(mo(r[r.length-2]),mo(r[r.length-1]),mo(o[1]),mo(o[0])))?[].concat(r.slice(0,r.length-1),[a],o.slice(1)):[mo(r[0]),mo(o[o.length-1])]);n.reconnectEnd(c,u.target,p)}}})}function mo(e){return e.original||e}function Pp(e,t){Z.call(this,e),this.preExecute("shape.delete",function(n){var i=n.shape,r=i.parent;P(i,"bpmn:Participant")&&(n.collaborationRoot=r)},!0),this.postExecute("shape.delete",function(n){var i=n.collaborationRoot;if(i&&!i.businessObject.participants.length){var r=t.makeProcess(),o=i.children.slice();t.moveElements(o,{x:0,y:0},r)}},!0)}function Rp(e,t,n,i){Z.call(this,e);var r=i.get("dragging",!1);function o(a){var s,c,u=a.source,p=a.target;a.parent&&(P(a,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(u,p)||(c=!0),n.canConnectMessageFlow(u,p)&&(s="bpmn:MessageFlow")),P(a,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(u,p)||(c=!0),n.canConnectSequenceFlow(u,p)&&(s="bpmn:SequenceFlow")),c&&t.removeConnection(a),s&&t.connect(u,p,{type:s,waypoints:a.waypoints.slice()}))}this.postExecuted("elements.move",function(a){$(a.closure.allConnections,o)},!0),this.preExecute("connection.reconnect",function(a){var s,c,u=a.context,p=u.connection,d=u.newSource||p.source,m=u.newTarget||p.target;(s=n.canConnect(d,m))&&s.type!==p.type&&(c=t.connect(d,m,{type:s.type,associationDirection:s.associationDirection,waypoints:p.waypoints.slice()}),p.parent&&t.removeConnection(p),u.connection=c,r&&function(f,v){var g,E=r.context(),_=E&&E.payload.previousSelection;_&&_.length&&(g=_.indexOf(f))!==-1&&_.splice(g,1,v)}(p,c))}),this.postExecuted("element.updateProperties",function(a){var s,c=a.context,u=c.properties,p=c.element,d=p.businessObject;u.default&&(s=Be(p.outgoing,Tn({id:p.businessObject.default.id})))&&t.updateProperties(s,{conditionExpression:void 0}),u.conditionExpression&&d.sourceRef.default===d&&t.updateProperties(p.source,{default:void 0})})}function ml(e,t,n,i,r,o){i.invoke(Z,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(a){var s=a.context,c=s.parent,u=s.elements,p=Ht(u,function(d,m){var f=t.canReplace([m],m.host||m.parent||c);return f?d.concat(f.replacements):d},[]);p.length&&this._replaceElements(u,p)},this),this.postExecuted(["elements.move"],500,function(a){var s=a.context,c=s.newParent,u=s.newHost,p=[];$(s.closure.topLevel,function(m){p=wt(m)?p.concat(m.children):p.concat(m)}),p.length===1&&u&&(c=u);var d=t.canReplace(p,c);d&&this._replaceElements(p,d.replacements,u)},this),this.postExecute(["shape.replace"],1500,function(a){var s,c=a.context,u=c.oldShape,p=c.newShape,d=u.attachers;d&&d.length&&(s=t.canReplace(d,p),this._replaceElements(d,s.replacements))},this),this.postExecuted(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,u=s.newShape;r.unclaimId(c.businessObject.id,c.businessObject),r.updateProperties(u,{id:c.id})})}kp.$inject=["injector","modeling"],le(kp,Z),le(Ap,Z),Ap.$inject=["eventBus","modeling"],le(Tp,Z),Tp.$inject=["eventBus","bpmnRules","modeling"],Pp.$inject=["eventBus","modeling"],le(Pp,Z),le(Rp,Z),Rp.$inject=["eventBus","modeling","bpmnRules","injector"],le(ml,Z),ml.prototype._replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;$(t,function(o){var a={type:o.newElementType},s=n.get(o.oldElementId),c=e.indexOf(s);e[c]=i.replaceElement(s,a,{select:!1})}),t&&r.select(e)},ml.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var w1={width:140,height:120},Mp={width:300,height:60},Np={width:60,height:300},fl={width:300,height:150},vl={width:150,height:300},Ny={width:140,height:120},Iy={width:50,height:30};function By(e){e.on("resize.start",1500,function(t){var n=t.context,i=n.shape,r=n.direction,o=n.balanced;(P(i,"bpmn:Lane")||P(i,"bpmn:Participant"))&&(n.resizeConstraints=function(a,s,c){var u=yn(a),p=!0,d=!0,m=sl(u,[u]),f=de(a),v={},g={},E=gt(a),_=E?Mp:Np;/n/.test(s)?g.top=f.bottom-_.height:/e/.test(s)?g.right=f.left+_.width:/s/.test(s)?g.bottom=f.top+_.height:/w/.test(s)&&(g.left=f.right-_.width),m.forEach(function(S){var k=de(S);E?(k.top<f.top-10&&(p=!1),k.bottom>f.bottom+10&&(d=!1)):(k.left<f.left-10&&(p=!1),k.right>f.right+10&&(d=!1)),/n/.test(s)&&(c&&Li(f.top-k.bottom)<10&&vo(v,"top",k.top+_.height),Li(f.top-k.top)<5&&fo(g,"top",k.bottom-_.height)),/e/.test(s)&&(c&&Li(f.right-k.left)<10&&fo(v,"right",k.right-_.width),Li(f.right-k.right)<5&&vo(g,"right",k.left+_.width)),/s/.test(s)&&(c&&Li(f.bottom-k.top)<10&&fo(v,"bottom",k.bottom-_.height),Li(f.bottom-k.bottom)<5&&vo(g,"bottom",k.top+_.height)),/w/.test(s)&&(c&&Li(f.left-k.right)<10&&vo(v,"left",k.left+_.width),Li(f.left-k.left)<5&&fo(g,"left",k.right-_.width))});var b=u.children.filter(function(S){return!S.hidden&&!S.waypoints&&(P(S,"bpmn:FlowElement")||P(S,"bpmn:Artifact"))}),w=E?k1:A1;return b.forEach(function(S){var k=de(S);!/n/.test(s)||E&&!p||fo(g,"top",k.top-w.top),/e/.test(s)&&(E||d)&&vo(g,"right",k.right+w.right),!/s/.test(s)||E&&!d||vo(g,"bottom",k.bottom+w.bottom),/w/.test(s)&&(E||p)&&fo(g,"left",k.left-w.left)}),{min:g,max:v}}(i,r,o)),P(i,"bpmn:SubProcess")&&Ae(i)&&(n.minDimensions=Ny),P(i,"bpmn:TextAnnotation")&&(n.minDimensions=Iy)})}By.$inject=["eventBus"];var Li=Math.abs,S1=Math.min,C1=Math.max;function Dy(e,t,n,i){var r=e[t];e[t]=r===void 0?n:i(n,r)}function fo(e,t,n){return Dy(e,t,n,S1)}function vo(e,t,n){return Dy(e,t,n,C1)}var k1={top:20,left:50,right:20,bottom:20},A1={top:50,left:20,right:20,bottom:20};function Oy(e,t){e.on("resize.start",1501,function(n){var i=n.context,r=i.shape;(P(r,"bpmn:Lane")||P(r,"bpmn:Participant"))&&(i.balanced=!Jo(n))}),e.on("resize.end",1001,function(n){var i=n.context,r=i.shape,o=i.canExecute,a=i.newBounds;if(P(r,"bpmn:Lane")||P(r,"bpmn:Participant"))return o&&(a=xm(a),t.resizeLane(r,a,i.balanced)),!1})}function Ip(e,t,n,i,r){function o(u){return Se(u,["bpmn:ReceiveTask","bpmn:SendTask"])||function(p,d){return Ee(d)||(d=[d]),Gt(d,function(m){return Xr(p,m)})}(u,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(u){return!!Be(e.getDefinitions().get("rootElements"),Tn({id:u.id}))}function s(u){return P(u,"bpmn:ErrorEventDefinition")?"errorRef":P(u,"bpmn:EscalationEventDefinition")?"escalationRef":P(u,"bpmn:MessageEventDefinition")?"messageRef":P(u,"bpmn:SignalEventDefinition")?"signalRef":void 0}function c(u){if(Se(u,["bpmn:ReceiveTask","bpmn:SendTask"]))return u.get("messageRef");var p=u.get("eventDefinitions")[0];return p.get(s(p))}n.invoke(Z,this),this.executed(["shape.create","element.updateProperties","element.updateModdleProperties"],function(u){var p=u.shape||u.element;if(o(p)){var d=c(Q(p));d&&!a(d)&&(ht(e.getDefinitions().get("rootElements"),d),u.addedRootElement=d)}},!0),this.reverted(["shape.create","element.updateProperties","element.updateModdleProperties"],function(u){var p=u.addedRootElement;p&&ot(e.getDefinitions().get("rootElements"),p)},!0),t.on("copyPaste.copyElement",function(u){var p=u.descriptor,d=u.element;if(!d.labelTarget&&o(d)){var m=c(Q(d));m&&(p.referencedRootElement=m)}}),t.on("copyPaste.pasteElement",500,function(u){var p=u.descriptor,d=p.businessObject,m=p.referencedRootElement;m&&(a(m)||(m=i.copyElement(m,r.create(m.$type))),function(f,v){if(Se(f,["bpmn:ReceiveTask","bpmn:SendTask"]))return f.set("messageRef",v);var g=f.get("eventDefinitions")[0];g.set(s(g),v)}(d,m),delete p.referencedRootElement)})}Oy.$inject=["eventBus","modeling"],Ip.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],le(Ip,Z);var Ly=Math.max;function jy(e){e.on("spaceTool.getMinDimensions",function(t){var n=t.shapes,i=t.axis,r=t.start,o={};return $(n,function(a){var s=a.id;P(a,"bpmn:Participant")&&(o[s]=function(c,u,p){var d=gt(c);if(!pi(c).length)return d?fl:vl;var m=function(f){return f==="x"}(u);return m?d?fl:{width:P1(c,p,m),height:vl.height}:d?{width:fl.width,height:T1(c,p,m)}:vl}(a,i,r)),P(a,"bpmn:Lane")&&(o[s]=gt(a)?Mp:Np),P(a,"bpmn:SubProcess")&&Ae(a)&&(o[s]=Ny),P(a,"bpmn:TextAnnotation")&&(o[s]=Iy),P(a,"bpmn:Group")&&(o[s]=w1)}),o})}function T1(e,t,n){var i;return i=function(r,o,a){var s;return s=Bp(pi(r),o,a),r.height-s.height+Mp.height}(e,t,n),Ly(fl.height,i)}function P1(e,t,n){var i;return i=function(r,o,a){var s;return s=Bp(pi(r),o,a),r.width-s.width+Np.width}(e,t,n),Ly(vl.width,i)}function Bp(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)return(o=pi(r)).length?Bp(o,t,n):r}jy.$inject=["eventBus"];function ji(e,t,n,i,r,o,a){Z.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(d){return P(d,"bpmn:SubProcess")&&!Ae(d)}function u(d){var m=d.shape,f=d.newRootElement,v=Q(m);f=s._addDiagram(f||v),d.newRootElement=e.addRootElement(f)}function p(d){var m=Q(d.shape);s._removeDiagram(m);var f=d.newRootElement=a.get(ai(m));e.removeRootElement(f)}this.executed("shape.create",function(d){c(d.shape)&&u(d)},!0),this.postExecuted("shape.create",function(d){var m=d.shape,f=d.newRootElement;f&&m.children&&(s._showRecursively(m.children),s._moveChildrenToShape(m,f))},!0),this.reverted("shape.create",function(d){c(d.shape)&&p(d)},!0),this.preExecuted("shape.delete",function(d){var m=d.shape;if(c(m)){var f=a.get(ai(m));f&&n.removeElements(f.children.slice())}},!0),this.executed("shape.delete",function(d){c(d.shape)&&p(d)},!0),this.reverted("shape.delete",function(d){c(d.shape)&&u(d)},!0),this.preExecuted("shape.replace",function(d){var m=d.oldShape,f=d.newShape;c(m)&&c(f)&&(d.oldRoot=e.removeRootElement(ai(m)))},!0),this.postExecuted("shape.replace",function(d){var m=d.newShape,f=d.oldRoot,v=e.findRoot(ai(m));if(f&&v){var g=f.children;n.moveElements(g,{x:0,y:0},v)}},!0),this.executed("element.updateProperties",function(d){var m=d.element;if(P(m,"bpmn:SubProcess")){var f=d.properties,v=d.oldProperties.id,g=f.id;if(v!==g){if(Ps(m))return a.updateId(m,fr(g)),void a.updateId(v,g);a.get(fr(v))&&a.updateId(fr(v),fr(g))}}},!0),this.reverted("element.updateProperties",function(d){var m=d.element;if(P(m,"bpmn:SubProcess")){var f=d.properties,v=d.oldProperties.id,g=f.id;if(v!==g){if(Ps(m))return a.updateId(m,fr(v)),void a.updateId(g,v);var E=a.get(fr(g));E&&a.updateId(E,fr(v))}}},!0),t.on("element.changed",function(d){var m=d.element;if(Ps(m)){var f=m,v=a.get(hf(f));v&&v!==f&&t.fire("element.changed",{element:v})}}),this.executed("shape.toggleCollapse",400,function(d){var m=d.shape;P(m,"bpmn:SubProcess")&&(Ae(m)?p(d):(u(d),s._showRecursively(m.children)))},!0),this.reverted("shape.toggleCollapse",400,function(d){var m=d.shape;P(m,"bpmn:SubProcess")&&(Ae(m)?p(d):(u(d),s._showRecursively(m.children)))},!0),this.postExecuted("shape.toggleCollapse",600,function(d){var m=d.shape;if(P(m,"bpmn:SubProcess")){var f=d.newRootElement;f&&(Ae(m)?s._moveChildrenToShape(f,m):s._moveChildrenToShape(m,f))}},!0),t.on("copyPaste.createTree",function(d){var m=d.element,f=d.children;if(c(m)){var v=ai(m),g=a.get(v);g&&f.push.apply(f,g.children)}}),t.on("copyPaste.copyElement",function(d){var m=d.descriptor,f=d.element,v=d.elements,g=f.parent;if(P(Me(g),"bpmndi:BPMNPlane")){var E=hf(g),_=Be(v,function(b){return b.id===E});_&&(m.parent=_.id)}}),t.on("copyPaste.pasteElement",function(d){var m=d.descriptor;m.parent&&(c(m.parent)||m.parent.hidden)&&(m.hidden=!0)})}function Dp(e,t){e.invoke(Z,this),this.postExecuted("shape.replace",function(n){var i=n.context.oldShape,r=n.context.newShape;if(P(r,"bpmn:SubProcess")&&(P(i,"bpmn:Task")||P(i,"bpmn:CallActivity"))&&Ae(r)){var o,a={x:(o=r).x+o.width/6,y:o.y+o.height/2};t.createShape({type:"bpmn:StartEvent"},a,r)}})}function Op(e){Z.call(this,e),this.preExecute("connection.create",function(t){const{target:n}=t;P(n,"bpmn:TextAnnotation")&&(t.parent=n.parent)},!0),this.preExecute(["shape.create","shape.resize","elements.move"],function(t){const n=t.shapes||[t.shape];n.length===1&&P(n[0],"bpmn:TextAnnotation")&&(t.hints=t.hints||{},t.hints.autoResize=!1)},!0)}function Lp(e,t){Z.call(this,e),this.postExecuted("shape.toggleCollapse",1500,function(n){var i=n.shape;if(!Ae(i)){var r=Oo(i);r.forEach(function(a){var s=a.incoming.slice(),c=a.outgoing.slice();$(s,function(u){o(u,!0)}),$(c,function(u){o(u,!1)})})}function o(a,s){r.indexOf(a.source)!==-1&&r.indexOf(a.target)!==-1||(s?t.reconnectEnd(a,i,ge(i)):t.reconnectStart(a,i,ge(i)))}},!0)}function jp(e,t,n){Z.call(this,e),this.executed(["shape.toggleCollapse"],500,function(i){var r,o=i.context.shape;P(o,"bpmn:SubProcess")&&(o.collapsed?Me(o).isExpanded=!1:((r=o.children).length&&r.forEach(function(a){a.type!=="label"||a.businessObject.name||(a.hidden=!0)}),Me(o).isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],500,function(i){var r=i.context.shape;r.collapsed?Me(r).isExpanded=!1:Me(r).isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],500,function(i){var r,o=i.context.shape,a=t.getDefaultSize(o);r=o.collapsed?function(s,c){return{x:s.x+(s.width-c.width)/2,y:s.y+(s.height-c.height)/2,width:c.width,height:c.height}}(o,a):function(s,c){var u,p,d,m=c;return u=(d=s.children,d.filter(function(f){return!f.hidden})).concat([s]),(p=cy(u))?(m.width=Math.max(p.width,m.width),m.height=Math.max(p.height,m.height),m.x=p.x+(p.width-m.width)/2,m.y=p.y+(p.height-m.height)/2):(m.x=s.x+(s.width-m.width)/2,m.y=s.y+(s.height-m.height)/2),m}(o,a),n.resizeShape(o,r,null,{autoResize:!o.collapsed&&"nwse"})})}function Vp(e,t,n,i){t.invoke(Z,this),this.preExecute("shape.delete",function(r){var o=r.context.shape,a=o.businessObject;Re(o)||(P(o,"bpmn:Participant")&&Ae(o)&&n.ids.unclaim(a.processRef.id),i.unclaimId(a.id,a))}),this.preExecute("connection.delete",function(r){var o=r.context.connection.businessObject;i.unclaimId(o.id,o)}),this.preExecute("canvas.updateRoot",function(){var r=e.getRootElement(),o=r.businessObject;P(r,"bpmn:Collaboration")&&n.ids.unclaim(o.id)})}function $p(e,t){Z.call(this,e),this.preExecute("connection.delete",function(n){var i=n.context.connection,r=i.source;(function(o,a){if(!P(o,"bpmn:SequenceFlow"))return!1;var s=Q(a),c=Q(o);return s.get("default")===c})(i,r)&&t.updateProperties(r,{default:null})})}function Fp(e,t){var n;Z.call(this,e);var i=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(i,5e3,function(r){(n=n||new R1).enter()}),this.postExecuted(i,500,function(r){(function(){if(!n)throw new Error("out of bounds release");n.leave()&&(t.updateLaneRefs(n.flowNodes,n.lanes),n=null)})()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(r){var o=r.context.shape,a=function(){if(!n)throw new Error("out of bounds release");return n}();o.labelTarget||(P(o,"bpmn:Lane")&&a.addLane(o),P(o,"bpmn:FlowNode")&&a.addFlowNode(o))})}function R1(){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}}function zp(e,t){Z.call(this,e),this.postExecuted("elements.create",function(n){const i=n.context.elements;for(const r of i)M1(r)&&!N1(r)&&t.updateProperties(r,{isForCompensation:void 0})})}function M1(e){const t=Q(e);return t&&t.isForCompensation}function N1(e){return e.incoming.filter(t=>function(n){return n&&P(n,"bpmn:BoundaryEvent")&&Xr(n,"bpmn:CompensateEventDefinition")}(t.source)).length>0}le(ji,Z),ji.prototype._moveChildrenToShape=function(e,t){var n,i=this._modeling,r=e.children;if(r){var o=(r=r.concat(r.reduce(function(u,p){return p.label&&p.label.parent!==e?u.concat(p.label):u},[]))).filter(function(u){return!u.hidden});if(o.length){var a=yt(o);if(t.x){var s=ge(t),c=ge(a);n={x:s.x-c.x,y:s.y-c.y}}else n={x:180-a.x,y:160-a.y};i.moveElements(r,n,t,{autoResize:!1})}else i.moveElements(r,{x:0,y:0},t,{autoResize:!1})}},ji.prototype._showRecursively=function(e,t){var n=this,i=[];return e.forEach(function(r){r.hidden=!!t,i=i.concat(r),r.children&&(i=i.concat(n._showRecursively(r.children,r.collapsed||t)))}),i},ji.prototype._addDiagram=function(e){var t=this._bpmnjs.getDefinitions().diagrams;return e.businessObject||(e=this._createNewDiagram(e)),t.push(e.di.$parent),e},ji.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:ai(e),type:e.$type,di:i,businessObject:e,collapsed:!0})},ji.prototype._removeDiagram=function(e){var t=this._bpmnjs.getDefinitions().diagrams,n=Be(t,function(i){return i.plane.bpmnElement.id===e.id});return t.splice(t.indexOf(n),1),n},ji.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"],Dp.$inject=["injector","modeling"],le(Dp,Z),le(Op,Z),Op.$inject=["eventBus"],le(Lp,Z),Lp.$inject=["eventBus","modeling"],le(jp,Z),jp.$inject=["eventBus","elementFactory","modeling"],le(Vp,Z),Vp.$inject=["canvas","injector","moddle","modeling"],le($p,Z),$p.$inject=["eventBus","modeling"],Fp.$inject=["eventBus","modeling"],le(Fp,Z),le(zp,Z),zp.$inject=["eventBus","modeling"];const I1={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","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","unsetDefaultFlowBehavior","setCompensationActivityAfterPasteBehavior"],adaptiveLabelPositioningBehavior:["type",op],appendBehavior:["type",ap],associationBehavior:["type",sp],attachEventBehavior:["type",el],boundaryEventBehavior:["type",lp],compensateBoundaryEventBehaviour:["type",cp],createBehavior:["type",up],createDataObjectBehavior:["type",pp],createParticipantBehavior:["type",dp],dataInputAssociationBehavior:["type",hp],dataStoreBehavior:["type",mp],deleteLaneBehavior:["type",fp],detachEventBehavior:["type",ll],dropOnFlowBehavior:["type",vp],eventBasedGatewayBehavior:["type",yp],fixHoverBehavior:["type",hy],groupBehavior:["type",gp],importDockingFix:["type",my],isHorizontalFix:["type",xp],labelBehavior:["type",_p],layoutConnectionBehavior:["type",Ep],messageFlowBehavior:["type",Cp],nonInterruptingBehavior:["type",kp],removeElementBehavior:["type",Tp],removeEmbeddedLabelBoundsBehavior:["type",Ap],removeParticipantBehavior:["type",Pp],replaceConnectionBehavior:["type",Rp],replaceElementBehaviour:["type",ml],resizeBehavior:["type",By],resizeLaneBehavior:["type",Oy],rootElementReferenceBehavior:["type",Ip],spaceToolBehavior:["type",jy],subProcessPlaneBehavior:["type",ji],subProcessStartEventBehavior:["type",Dp],textAnnotationBehavior:["type",Op],toggleCollapseConnectionBehaviour:["type",Lp],toggleElementCollapseBehaviour:["type",jp],unclaimIdBehavior:["type",Vp],unsetDefaultFlowBehavior:["type",$p],updateFlowNodeRefsBehavior:["type",Fp],setCompensationActivityAfterPasteBehavior:["type",zp]};function Vy(e,t){var n=Tt(e,t,-15);return n!=="intersect"?n:null}function Ct(e){mn.call(this,e)}function Up(e){return!e||Re(e)}function $y(e){do{if(P(e,"bpmn:Process"))return Q(e);if(P(e,"bpmn:Participant"))return Q(e).processRef||Q(e)}while(e=e.parent)}function Hp(e){return P(e,"bpmn:TextAnnotation")}function Gp(e){return P(e,"bpmn:Group")&&!e.labelTarget}function Fy(e){return P(e,"bpmn:BoundaryEvent")&&Kn(e,"bpmn:CompensateEventDefinition")}function yl(e){return Q(e).isForCompensation}function zy(e){for(var t=e;t=t.parent;){if(P(t,"bpmn:FlowElementsContainer"))return Q(t);if(P(t,"bpmn:Participant"))return Q(t).processRef}return null}function Uy(e,t){return zy(e)===zy(t)}function Kn(e,t){return!!Be(Q(e).eventDefinitions||[],function(n){return P(n,t)})}function Hy(e,t){return(Q(e).eventDefinitions||[]).every(function(n){return P(n,t)})}function Wp(e,t){var n=function(i){for(var r=[];i;)(i=i.parent)&&r.push(i);return r}(t);return n.indexOf(e)!==-1}function gl(e,t,n){if(Up(e)||Up(t))return null;if(!P(n,"bpmn:DataAssociation")){if(Qy(e,t))return{type:"bpmn:MessageFlow"};if(eg(e,t))return{type:"bpmn:SequenceFlow"}}return Kp(e,t)||(Zy(e,t)?{type:"bpmn:Association",associationDirection:"One"}:!!Jy(e,t)&&{type:"bpmn:Association",associationDirection:"None"})}function yo(e,t){return!(!Re(e)&&!Gp(e))||!(P(t,"bpmn:Participant")&&!Ae(t))&&(P(e,"bpmn:Participant")?P(t,"bpmn:Process")||P(t,"bpmn:Collaboration"):Se(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:P(e,"bpmn:Lane")?P(t,"bpmn:Participant")||P(t,"bpmn:Lane"):!(P(e,"bpmn:BoundaryEvent")&&!function(n){return Q(n).cancelActivity&&(Gy(n)||Wy(n))}(e))&&(P(e,"bpmn:FlowElement")&&!P(e,"bpmn:DataStoreReference")?P(t,"bpmn:FlowElementsContainer")?Ae(t):Se(t,["bpmn:Participant","bpmn:Lane"]):P(e,"bpmn:DataStoreReference")&&P(t,"bpmn:Collaboration")?Gt(Q(t).get("participants"),function(n){return!!n.get("processRef")}):Se(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?Se(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!P(e,"bpmn:MessageFlow")&&(P(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t)))}function B1(e){return P(e,"bpmn:Lane")}function Gy(e){var t=Q(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function Wy(e){return qy(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function qy(e,t){return t.some(function(n){return Kn(e,n)})}function da(e,t,n,i){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var r=e[0];return!Re(r)&&!!function(o){return!!function(a){return!Re(a)&&P(a,"bpmn:BoundaryEvent")}(o)||!(!P(o,"bpmn:IntermediateThrowEvent")||!Gy(o))||P(o,"bpmn:IntermediateCatchEvent")&&Wy(o)}(r)&&!wt(t)&&!(!P(t,"bpmn:Activity")||yl(t))&&!(i&&!Vy(i,t))&&!function(o){return P(o,"bpmn:ReceiveTask")&&Be(o.incoming,function(a){return P(a.source,"bpmn:EventBasedGateway")})}(t)&&"attach"}function Ky(e,t,n){if(!t)return!1;var i={replacements:[]};return $(e,function(r){wt(t)||P(r,"bpmn:StartEvent")&&r.type!=="label"&&yo(r,t)&&(function(o){return o&&Q(o).isInterrupting!==!1}(r)||i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),(function(o){return Xr(o,"bpmn:ErrorEventDefinition")}(r)||function(o){return Xr(o,"bpmn:EscalationEventDefinition")}(r)||function(o){return Xr(o,"bpmn:CompensateEventDefinition")}(r))&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),qy(r,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&P(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"})),P(t,"bpmn:Transaction")||Kn(r,"bpmn:CancelEventDefinition")&&r.type!=="label"&&(P(r,"bpmn:EndEvent")&&yo(r,t)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:EndEvent"}),P(r,"bpmn:BoundaryEvent")&&da(r,t,0,n)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:BoundaryEvent"}))}),!!i.replacements.length&&i}function Xy(e,t){return!Gt(e,B1)&&(!t||e.every(function(n){return yo(n,t)}))}function qp(e,t,n,i){return!!t&&(!(!Re(e)&&!Gp(e))||!function(r,o){return r===o}(n,t)&&(!n||!Wp(n,t))&&(yo(e,t)||bl(e,t)))}function Yy(e,t){return P(e,"bpmn:SubProcess")?Ae(e)&&(!t||t.width>=100&&t.height>=80):!!(P(e,"bpmn:Lane")||P(e,"bpmn:Participant")||Hp(e)||Gp(e))}function Jy(e,t){return!(Wp(t,e)||Wp(e,t)||!function(n,i){var r=Hp(n),o=Hp(i);return(r||o)&&r!==o}(e,t)&&!Kp(e,t))}function Zy(e,t){return Uy(e,t)&&Fy(e)&&P(t,"bpmn:Activity")&&(n=e,!t.attachers.includes(n))&&!wt(t);var n}function Qy(e,t){return!(ng(e)&&!ng(t))&&P(n=e,"bpmn:InteractionNode")&&!P(n,"bpmn:BoundaryEvent")&&(!P(n,"bpmn:Event")||P(n,"bpmn:ThrowEvent")&&Hy(n,"bpmn:MessageEventDefinition"))&&function(i){return P(i,"bpmn:InteractionNode")&&!yl(i)&&(!P(i,"bpmn:Event")||P(i,"bpmn:CatchEvent")&&Hy(i,"bpmn:MessageEventDefinition"))&&!(P(i,"bpmn:BoundaryEvent")&&!Kn(i,"bpmn:MessageEventDefinition"))}(t)&&!function(i,r){return $y(i)===$y(r)}(e,t);var n}function eg(e,t){return P(n=e,"bpmn:FlowNode")&&!P(n,"bpmn:EndEvent")&&!wt(n)&&!(P(n,"bpmn:IntermediateThrowEvent")&&Kn(n,"bpmn:LinkEventDefinition"))&&!Fy(n)&&!yl(n)&&function(i){return P(i,"bpmn:FlowNode")&&!P(i,"bpmn:StartEvent")&&!P(i,"bpmn:BoundaryEvent")&&!wt(i)&&!(P(i,"bpmn:IntermediateCatchEvent")&&Kn(i,"bpmn:LinkEventDefinition"))&&!yl(i)}(t)&&Uy(e,t)&&!(P(e,"bpmn:EventBasedGateway")&&!function(i){return P(i,"bpmn:ReceiveTask")||P(i,"bpmn:IntermediateCatchEvent")&&(Kn(i,"bpmn:MessageEventDefinition")||Kn(i,"bpmn:TimerEventDefinition")||Kn(i,"bpmn:ConditionalEventDefinition")||Kn(i,"bpmn:SignalEventDefinition"))}(t));var n}function Kp(e,t){return Se(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&Se(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!Se(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!Se(e,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function bl(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(e.length!==1)return!1;e=e[0]}return t.source!==e&&t.target!==e&&Se(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!Re(t)&&P(e,"bpmn:FlowNode")&&!P(e,"bpmn:BoundaryEvent")&&yo(e,t.parent)}function tg(e,t){return!!Re(t)||!(P(t,"bpmn:Lane")&&!function(n,i){return n&&i&&n.indexOf(i)!==-1}(e,t.parent))}function ng(e){return ao(e,"bpmn:Process")||ao(e,"bpmn:Collaboration")}le(Ct,mn),Ct.$inject=["eventBus"],Ct.prototype.init=function(){this.addRule("connection.start",function(e){return Up(t=e.source)?null:Se(t,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"]);var t}),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 gl(t,n)}finally{r&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection;return gl(e.source,e.target,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){return Yy(e.shape,e.newBounds)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,i=e.target;return!(Fe(i)&&!bl(t,i))&&ar(t,function(r){return Fe(r)?gl(r.source,r.target,r):r.host?da(r,r.host,0,n):qp(r,i,null)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,i=e.position;return da(n,t,0,i)||Ky(n,t,i)||Xy(n,t)||bl(n,t)}),this.addRule("shape.create",function(e){return qp(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return da(e.shape,e.target,0,e.position)}),this.addRule("element.copy",function(e){var t=e.element;return tg(e.elements,t)})},Ct.prototype.canConnectMessageFlow=Qy,Ct.prototype.canConnectSequenceFlow=eg,Ct.prototype.canConnectDataAssociation=Kp,Ct.prototype.canConnectAssociation=Jy,Ct.prototype.canConnectCompensationAssociation=Zy,Ct.prototype.canMove=Xy,Ct.prototype.canAttach=da,Ct.prototype.canReplace=Ky,Ct.prototype.canDrop=yo,Ct.prototype.canInsert=bl,Ct.prototype.canCreate=qp,Ct.prototype.canConnect=gl,Ct.prototype.canResize=Yy,Ct.prototype.canCopy=tg;const D1={__depends__:[qn],__init__:["bpmnRules"],bpmnRules:["type",Ct]};function ig(e,t){e.on("saveXML.start",2e3,function(){$(t.getRootElements(),function(n){var i,r=Me(n);i=kt(Ce(Oo([n],!1),function(o){return o!==n&&!o.labelTarget}),Me),r.set("planeElement",i)})})}ig.$inject=["eventBus","canvas"];const O1={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",ig]};function xl(e){Z.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],function(n){var i=n.context,r=i.shape||i.connection,o=i.parent,a=t.getOrdering(r,o);a&&(a.parent!==void 0&&(i.parent=a.parent),i.parentIndex=a.index)}),this.preExecute(["shape.move","connection.move"],function(n){var i=n.context,r=i.shape||i.connection,o=i.newParent||r.parent,a=t.getOrdering(r,o);a&&(a.parent!==void 0&&(i.newParent=a.parent),i.newParentIndex=a.index)})}function Xp(e,t){xl.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(r){var o=r.order;if(o||(r.order=o=function(a){if(a.labelTarget)return{level:10};var s=Be(n,function(c){return Se(a,[c.type])});return s&&s.order||{level:1}}(r)),!o)throw new Error(`no order for <${r.id}>`);return o}this.getOrdering=function(r,o){if(r.labelTarget||P(r,"bpmn:TextAnnotation"))return{parent:t.findRoot(o)||t.getRootElement(),index:-1};var a=i(r);a.containers&&(o=function(u,p,d){for(var m=p;m&&!Se(m,d);)m=m.parent;if(!m)throw new Error(`no parent for <${u.id}> in <${p&&p.id}>`);return m}(r,o,a.containers));var s=o.children.indexOf(r),c=jh(o.children,function(u){return!(!r.labelTarget&&u.labelTarget)&&a.level<i(u).level});return c!==-1&&s!==-1&&s<c&&(c-=1),{index:c,parent:o}}}xl.prototype.getOrdering=function(e,t){return null},le(xl,Z),Xp.$inject=["eventBus","canvas"],le(Xp,xl);const L1={__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",Xp]};function ha(){}ha.prototype.get=function(){return this._data},ha.prototype.set=function(e){this._data=e},ha.prototype.clear=function(){var e=this._data;return delete this._data,e},ha.prototype.isEmpty=function(){return!this._data};const j1={clipboard:["type",ha]};var V1="drop-ok",rg="drop-not-ok",og="attach-ok",ag="new-parent",sg="create";function lg(e,t,n,i,r){function o(s,c){[og,V1,rg,ag].forEach(function(u){u===c?e.addMarker(s,u):e.removeMarker(s,u)})}function a(){var s=t.context();s&&s.prefix===sg&&t.cancel()}n.on(["create.move","create.hover"],function(s){var c=s.context,u=c.elements,p=s.hover,d=c.source,m=c.hints||{};if(!p)return c.canExecute=!1,void(c.target=null);cg(s);var f={x:s.x,y:s.y},v=c.canExecute=p&&function(g,E,_,b,w){if(!E)return!1;var S=Be(g=Ce(g,function(x){var C=x.labelTarget;return!(x.parent||Re(x)&&g.indexOf(C)!==-1)}),function(x){return!Fe(x)}),k=!1,l=!1,h=!1;ug(g)&&(k=r.allowed("shape.attach",{position:_,shape:S,target:E})),k||(h=ug(g)?r.allowed("shape.create",{position:_,shape:S,source:b,target:E}):r.allowed("elements.create",{elements:g,position:_,target:E}));var y=w.connectionTarget;return h||k?(S&&b&&(l=r.allowed("connection.create",{source:y===b?S:b,target:y===b?b:S,hints:{targetParent:E,targetAttach:k}})),{attach:k,connect:l}):(h===null||k===null)&&null}(u,p,f,d,m);p&&v!==null&&(c.target=p,v&&v.attach?o(p,og):o(p,v?ag:rg))}),n.on(["create.end","create.out","create.cleanup"],function(s){var c=s.hover;c&&o(c,null)}),n.on("create.end",function(s){var c=s.context,u=c.source,p=c.shape,d=c.elements,m=c.target,f=c.canExecute,v=f&&f.attach,g=f&&f.connect,E=c.hints||{};if(f===!1||!m)return!1;cg(s);var _={x:s.x,y:s.y};p=g?i.appendShape(u,p,_,m,{attach:v,connection:g===!0?{}:g,connectionTarget:E.connectionTarget}):Be(d=i.createElements(d,_,m,z({},E,{attach:v})),function(b){return!Fe(b)}),z(c,{elements:d,shape:p}),z(s,{elements:d,shape:p})}),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(s,c,u){Ee(c)||(c=[c]);var p=Be(c,function(m){return!Fe(m)});if(p){u=z({elements:c,hints:{},shape:p},u||{}),$(c,function(m){ye(m.x)||(m.x=0),ye(m.y)||(m.y=0)});var d=yt(Ce(c,function(m){return!m.hidden}));$(c,function(m){Fe(m)&&(m.waypoints=kt(m.waypoints,function(f){return{x:f.x-d.x-d.width/2,y:f.y-d.y-d.height/2}})),z(m,{x:m.x-d.x-d.width/2,y:m.y-d.y-d.height/2})}),t.init(s,sg,{cursor:"grabbing",autoActivate:!0,data:{shape:p,elements:c,context:u}})}}}function cg(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 ug(e){return e&&e.length===1&&!Fe(e[0])}function pg(e,t,n,i,r){t.on("create.move",750,function(o){var a=o.hover,s=o.context,c=s.elements,u=s.dragGroup;u||(u=s.dragGroup=function(p){var d=ue("g");ae(d,r.cls("djs-drag-group",["no-events"]));var m=ue("g");return p.forEach(function(f){var v;f.hidden||(f.waypoints?(v=n._createContainer("connection",m),n.drawConnection(cr(v),f)):(v=n._createContainer("shape",m),n.drawShape(cr(v),f),Et(v,f.x,f.y)),i.addDragger(f,d,v))}),d}(c)),a?(u.parentNode||xe(e.getActiveLayer(),u),Et(u,o.x,o.y)):dt(u)}),t.on("create.cleanup",function(o){var a=o.context.dragGroup;a&&dt(a)})}lg.$inject=["canvas","dragging","eventBus","modeling","rules"],pg.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];const _l={__depends__:[ci,uo,qn,Gn],__init__:["create","createPreview"],create:["type",lg],createPreview:["type",pg]};function Yp(e){var t=this;function n(i){t._lastMoveEvent=i}this._lastMoveEvent=null,e.on("canvas.init",function(i){(t._svg=i.svg).addEventListener("mousemove",n)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)})}Yp.$inject=["eventBus"],Yp.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||function(){var e=document.createEvent("MouseEvent");return e.initMouseEvent&&e.initMouseEvent("mousemove",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e}()};const ma={__init__:["mouse"],mouse:["type",Yp]};function Mn(e,t,n,i,r,o,a,s){this._canvas=e,this._create=t,this._clipboard=n,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=a,this._rules=s,r.on("copyPaste.copyElement",function(c){var u=c.descriptor,p=c.element,d=c.elements;u.priority=1,u.id=p.id;var m=Be(d,function(f){return f===p.parent});m&&(u.parent=p.parent.id),function(f){return!!f.host}(p)&&(u.priority=2,u.host=p.host.id),Fe(p)&&(u.priority=3,u.source=p.source.id,u.target=p.target.id,u.waypoints=function(f){return kt(f.waypoints,function(v){return(v=dg(v)).original&&(v.original=dg(v.original)),v})}(p)),Re(p)&&(u.priority=4,u.labelTarget=p.labelTarget.id),$(["x","y","width","height"],function(f){ye(p[f])&&(u[f]=p[f])}),u.hidden=p.hidden,u.collapsed=p.collapsed}),r.on("copyPaste.pasteElements",function(c){z(c.hints,{createElementsBehavior:!1})})}function dg(e){return z({},e)}function $1(e,t){var n=t.indexOf(e);return n===-1?t:t.splice(n,1)}Mn.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],Mn.prototype.copy=function(e){var t,n;return Ee(e)||(e=e?[e]:[]),n=(t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}))===!1?{}:this.createTree(Ee(t)?t:e),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:n}),n},Mn.prototype.paste=function(e){var t=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=e&&e.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var i=this._createElements(t);if(e&&e.element&&e.point)return this._paste(i,e.element,e.point,n);this._create.start(this._mouse.getLastMoveEvent(),i,{hints:n||{}})}},Mn.prototype._paste=function(e,t,n,i){$(e,function(o){ye(o.x)||(o.x=0),ye(o.y)||(o.y=0)});var r=yt(e);return $(e,function(o){Fe(o)&&(o.waypoints=kt(o.waypoints,function(a){return{x:a.x-r.x-r.width/2,y:a.y-r.y-r.height/2}})),z(o,{x:o.x-r.x-r.width/2,y:o.y-r.y-r.height/2})}),this._modeling.createElements(e,n,t,z({},i))},Mn.prototype._createElements=function(e){var t=this,n=this._eventBus,i={},r=[];return $(e,function(o,a){$(o=$n(o,"priority"),function(s){var c,u=z({},cn(s,["priority"]));return i[s.parent]?u.parent=i[s.parent]:delete u.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:u}),Fe(u)?(u.source=i[s.source],u.target=i[s.target],c=i[s.id]=t.createConnection(u),void r.push(c)):Re(u)?(u.labelTarget=i[u.labelTarget],c=i[s.id]=t.createLabel(u),void r.push(c)):(u.host&&(u.host=i[u.host]),c=i[s.id]=t.createShape(u),void r.push(c))})}),r},Mn.prototype.createConnection=function(e){return this._elementFactory.createConnection(cn(e,["id"]))},Mn.prototype.createLabel=function(e){return this._elementFactory.createLabel(cn(e,["id"]))},Mn.prototype.createShape=function(e){return this._elementFactory.createShape(cn(e,["id"]))},Mn.prototype.hasRelations=function(e,t){var n,i;return!(Fe(e)&&(n=Be(t,Tn({id:e.source.id})),i=Be(t,Tn({id:e.target.id})),!n||!i)||Re(e)&&!Be(t,Tn({id:e.labelTarget.id})))},Mn.prototype.createTree=function(e){var t=this._rules,n=this,i={},r=[];function o(a,s){var c=Be(r,function(u){return a===u.element});c?c.depth<s&&(r=function(u,p){var d=p.indexOf(u);return d!==-1&&p.splice(d,1),p}(c,r),r.push({element:c.element,depth:s})):r.push({element:a,depth:s})}return lr(ls(e),function(a,s,c){if(!Re(a)){$(a.labels,function(p){o(p,c)}),$([a.attachers,a.incoming,a.outgoing],function(p){p&&p.length&&$(p,function(d){$(d.labels,function(m){o(m,c)}),o(d,c)})}),o(a,c);var u=[];return a.children&&(u=a.children.slice()),n._eventBus.fire("copyPaste.createTree",{element:a,children:u}),u}}),e=kt(r,function(a){return a.element}),r=kt(r,function(a){return a.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:a.descriptor,element:a.element,elements:e}),a}),r=$n(r,function(a){return a.descriptor.priority}),e=kt(r,function(a){return a.element}),$(r,function(a){var s=a.depth;n.hasRelations(a.element,e)&&function(c,u){return t.allowed("element.copy",{element:c,elements:u})}(a.element,e)?(i[s]||(i[s]=[]),i[s].push(a.descriptor)):$1(a.element,e)}),i};const F1={__depends__:[j1,_l,ma,qn],__init__:["copyPaste"],copyPaste:["type",Mn]};function Jp(e,t,n){Ee(n)||(n=[n]),$(n,function(i){or(e[i])||(t[i]=e[i])})}function hg(e,t,n){function i(o,a){var s=e.create(o.$type);return n.copyElement(o,s,null,a)}t.on("copyPaste.copyElement",750,function(o){var a=o.descriptor,s=o.element,c=Q(s);if(Re(s))return a;var u=a.businessObject=i(c,!0),p=a.di=i(Me(s),!0);p.bpmnElement=u,Jp(u,a,"name"),Jp(p,a,"isExpanded"),c.default&&(a.default=c.default.id)});var r="-bpmn-js-refs";t.on("copyPaste.pasteElement",function(o){var a=o.cache,s=o.descriptor,c=s.businessObject,u=s.di;if(Re(s))return s.businessObject=Q(a[s.labelTarget]),void(s.di=Me(a[s.labelTarget]));c=s.businessObject=i(c),(u=s.di=i(u)).bpmnElement=c,Jp(s,c,["isExpanded","name"]),s.type=c.$type}),t.on("copyPaste.copyElement",750,function(o){var a=o.descriptor,s=o.element;if(P(s,"bpmn:Participant")){var c=Q(s);c.processRef&&(a.processRef=i(c.processRef,!0))}}),t.on("copyPaste.pasteElement",function(o){var a=o.descriptor,s=a.processRef;s&&(a.processRef=i(s))}),t.on("copyPaste.pasteElement",750,function(o){var a=o.cache;(function(s,c){s[r]=c})(a,function(s,c,u){var p=Q(s);return s.default&&(u[s.default]={element:p,property:"default"}),s.host&&(Q(s).attachedToRef=Q(c[s.host])),cn(u,Ht(u,function(d,m,f){var v=m.element,g=m.property;return f===s.id&&(v.set(g,p),d.push(s.id)),d},[]))}(o.descriptor,a,function(s){return s[r]=s[r]||{}}(a)))})}hg.$inject=["bpmnFactory","eventBus","moddleCopy"];var z1=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"];function fa(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",function(i){var r=i.propertyNames;if(r&&r.length)return $n(r,function(o){return o==="extensionElements"})}),e.on("moddleCopy.canCopyProperty",function(i){var r=i.parent,o=vt(r)&&r.$descriptor,a=i.propertyName;return(!a||z1.indexOf(a)===-1)&&!(a&&o&&!Be(o.properties,Tn({name:a})))&&void 0}),e.on("moddleCopy.canSetCopiedProperty",function(i){var r,o=i.property;if((r=o)&&rt(r.$instanceOf)&&r.$instanceOf("bpmn:ExtensionElements")&&(!o.values||!o.values.length))return!1})}function Zp(e,t){return Ht(e.properties,function(n,i){return t&&i.default?n:n.concat(i.name)},[])}fa.$inject=["eventBus","bpmnFactory","moddle"],fa.prototype.copyElement=function(e,t,n,i=!1){var r=this;n&&!Ee(n)&&(n=[n]),n=n||Zp(e.$descriptor);var o=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t,clone:i});return o===!1||(Ee(o)&&(n=o),$(n,function(a){var s;Lt(e,a)&&(s=e.get(a));var c=r.copyProperty(s,t,a,i);xt(c)&&r._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:c,propertyName:a})!==!1&&t.set(a,c)})),t},fa.prototype.copyProperty=function(e,t,n,i=!1){var r=this,o=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n,clone:i});if(o!==!1){if(o)return vt(o)&&o.$type&&!o.$parent&&(o.$parent=t),o;var a=this._moddle.getPropertyDescriptor(t,n);if(!a.isReference)return a.isId?e&&this._copyId(e,t,i):Ee(e)?Ht(e,function(s,c){return(o=r.copyProperty(c,t,n,i))?s.concat(o):s},[]):vt(e)&&e.$type?this._moddle.getElementDescriptor(e).isGeneric?void 0:((o=r._bpmnFactory.create(e.$type)).$parent=t,o=r.copyElement(e,o,null,i)):e}},fa.prototype._copyId=function(e,t,n=!1){return n?e:this._moddle.ids.assigned(e)?void 0:(this._moddle.ids.claim(e,t),e)};const mg={__depends__:[F1],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",hg],moddleCopy:["type",fa]};var fg=Math.round;function Qp(e,t){this._modeling=e,this._eventBus=t}function vg(e,t){t.on("replace.end",500,function(n){const{newElement:i,hints:r={}}=n;r.select!==!1&&e.select(i)})}Qp.$inject=["modeling","eventBus"],Qp.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,u=fg(s+o/2),p=fg(c+a/2),d=i.replaceShape(e,z({},t,{x:u,y:p,width:o,height:a}),n);return r.fire("replace.end",{element:e,newElement:d,hints:n}),d},vg.$inject=["selection","eventBus"];const U1={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",vg],replace:["type",Qp]};var H1=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function yg(e,t,n,i,r,o){this.replaceElement=function(a,s,c){c=c||{};var u=s.type,p=a.businessObject;if(El(p)&&u==="bpmn:SubProcess"&&function(_,b){var w=_&&Lt(_,"collapsed")?_.collapsed:!Ae(_);return w!==(b&&(Lt(b,"collapsed")||Lt(b,"isExpanded"))?Lt(b,"collapsed")?b.collapsed:!b.isExpanded:w)}(a,s))return i.toggleCollapse(a),a;var d=e.create(u),m={type:u,businessObject:d,di:{}};u==="bpmn:ExclusiveGateway"&&(m.di.isMarkerVisible=!0),function(_,b,w){Ee(w)||(w=[w]),$(w,function(S){or(_[S])||(b[S]=_[S])})}(a.di,m.di,["fill","stroke","background-color","border-color","color"]);var f=function(_,b){return _.filter(function(w){return b.includes(w)})}(Zp(p.$descriptor),Zp(d.$descriptor,!0));z(d,Pn(s,H1));var v=Ce(f,function(_){return _==="eventDefinitions"?gg(a,s.eventDefinitionType):_==="loopCharacteristics"?!wt(d):!(Lt(d,_)||_==="processRef"&&s.isExpanded===!1||_==="triggeredByEvent"||_==="isForCompensation"&&wt(d))});if(d=n.copyElement(p,d,v),s.eventDefinitionType&&(gg(d,s.eventDefinitionType)||(m.eventDefinitionType=s.eventDefinitionType,m.eventDefinitionAttrs=s.eventDefinitionAttrs)),P(p,"bpmn:Activity")){if(El(p))m.isExpanded=Ae(a);else if(s&&Lt(s,"isExpanded")){m.isExpanded=s.isExpanded;var g=t.getDefaultSize(d,{isExpanded:m.isExpanded});m.width=g.width,m.height=g.height,m.x=a.x-(m.width-a.width)/2,m.y=a.y-(m.height-a.height)/2}Ae(a)&&!P(p,"bpmn:Task")&&m.isExpanded&&(m.width=a.width,m.height=a.height)}if(El(p)&&!El(d)&&(c.moveChildren=!1),P(p,"bpmn:Participant")){s.isExpanded===!0?d.processRef=e.create("bpmn:Process"):c.moveChildren=!1;var E=gt(a);Me(a).isHorizontal||(Me(m).isHorizontal=E),m.width=E?a.width:t.getDefaultSize(m).width,m.height=E?t.getDefaultSize(m).height:a.height}return o.allowed("shape.resize",{shape:d})||(m.height=t.getDefaultSize(m).height,m.width=t.getDefaultSize(m).width),d.name=p.name,Se(p,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&Se(d,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(d.default=p.default),s.host&&!P(p,"bpmn:BoundaryEvent")&&P(d,"bpmn:BoundaryEvent")&&(m.host=s.host),m.type!=="bpmn:DataStoreReference"&&m.type!=="bpmn:DataObjectReference"||(m.x=a.x+(a.width-m.width)/2),r.replaceElement(a,m,{...c,targetElement:s})}}function El(e){return P(e,"bpmn:SubProcess")}function gg(e,t){var n=Q(e);return t&&n.get("eventDefinitions").some(function(i){return P(i,t)})}yg.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules"];const bg={__depends__:[mg,U1,Gn],bpmnReplace:["type",yg]};function wr(e){this._eventBus=e,this._tools=[],this._active=null}wr.$inject=["eventBus"],wr.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error(`A tool has to be registered with it's "events"`);n.push(e),this.bindEvents(e,t)},wr.prototype.isActive=function(e){return e&&this._active===e},wr.prototype.length=function(e){return this._tools.length},wr.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},wr.prototype.bindEvents=function(e,t){var n=this._eventBus,i=[];n.on(t.tool+".init",function(r){r.context.reactivate||!this.isActive(e)?this.setActive(e):this.setActive(null)},this),$(t,function(r){i.push(r+".ended"),i.push(r+".canceled")}),n.on(i,250,function(r){this._active&&(function(o){var a=o.originalEvent&&o.originalEvent.target;return a&&Zn(a,'.group[data-group="tools"]')}(r)||this.setActive(null))},this)};const wl={__depends__:[ci],__init__:["toolManager"],toolManager:["type",wr]};function va(e,t){return e.indexOf(t)!==-1}var ed=Math.abs,G1=Math.round,di={x:"width",y:"height"},xg="crosshair",Vi={n:"top",w:"left",s:"bottom",e:"right"},Sl={n:"s",w:"e",s:"n",e:"w"};function gn(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(c){n.once("spaceTool.selection.ended",function(){s.activateMakeSpace(c.originalEvent)})}),n.on("spaceTool.move",1500,function(c){var u=c.context,p=u.initialized;p||(p=u.initialized=s.init(c,u)),p&&Eg(c)}),n.on("spaceTool.end",function(c){var u=c.context,p=u.axis,d=u.direction,m=u.movingShapes,f=u.resizingShapes,v=u.start;if(u.initialized){Eg(c);var g={x:0,y:0};g[p]=G1(c["d"+p]),s.makeSpace(m,f,g,d,v),n.once("spaceTool.ended",function(E){s.activateSelection(E.originalEvent,!0,!0)})}})}function _g(e){return{top:e.top-20,right:e.right+20,bottom:e.bottom+20,left:e.left-20}}function Eg(e){var t,n,i=e.context.spaceToolConstraints;i&&(ye(i.left)&&(t=Math.max(e.x,i.left),e.dx=e.dx+t-e.x,e.x=t),ye(i.right)&&(t=Math.min(e.x,i.right),e.dx=e.dx+t-e.x,e.x=t),ye(i.top)&&(n=Math.max(e.y,i.top),e.dy=e.dy+n-e.y,e.y=n),ye(i.bottom)&&(n=Math.min(e.y,i.bottom),e.dy=e.dy+n-e.y,e.y=n))}function Sr(e,t){return e.indexOf(t)!==-1}gn.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],gn.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:xg,data:{context:{reactivate:n}},trapClick:!1})},gn.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:xg,data:{context:{}}})},gn.prototype.makeSpace=function(e,t,n,i,r){return this._modeling.createSpace(e,t,n,i,r)},gn.prototype.init=function(e,t){var n=ed(e.dx)>ed(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if(ed(i)<5)return!1;i<0&&(i*=-1),Jo(e)&&(i*=-1);var o=function(p,d){if(p==="x"){if(d>0)return"e";if(d<0)return"w"}if(p==="y"){if(d>0)return"s";if(d<0)return"n"}return null}(n,i),a=this._canvas.getRootElement();!Ns(e)&&e.hover&&(a=e.hover);var s=[...Oo(a,!0),...a.attachers||[]],c=this.calculateAdjustments(s,n,i,r),u=function(p,d,m,f,v){var g=p.movingShapes,E=p.resizingShapes;if(E.length){var _,b,w={};return $(E,function(S){var k,l,h,y,x,C,N=S.attachers,O=S.children,B=de(S),H=Ce(O,function(X){return!(Fe(X)||Re(X)||Sr(g,X)||Sr(E,X))}),q=Ce(O,function(X){return!Fe(X)&&!Re(X)&&Sr(g,X)}),U=[],V=[];H.length&&(l=_g(de(yt(H))),k=f-B[Vi[m]]+l[Vi[m]],m==="n"?w.bottom=b=ye(b)?Math.min(b,k):k:m==="w"?w.right=b=ye(b)?Math.min(b,k):k:m==="s"?w.top=_=ye(_)?Math.max(_,k):k:m==="e"&&(w.left=_=ye(_)?Math.max(_,k):k)),q.length&&(h=_g(de(yt(q))),k=f-h[Vi[Sl[m]]]+B[Vi[Sl[m]]],m==="n"?w.bottom=b=ye(b)?Math.min(b,k):k:m==="w"?w.right=b=ye(b)?Math.min(b,k):k:m==="s"?w.top=_=ye(_)?Math.max(_,k):k:m==="e"&&(w.left=_=ye(_)?Math.max(_,k):k)),N&&N.length&&(N.forEach(function(X){Sr(g,X)?U.push(X):V.push(X)}),U.length&&(y=de(yt(U.map(ge))),x=B[Vi[Sl[m]]]-(y[Vi[Sl[m]]]-f)),V.length&&(C=de(yt(V.map(ge)))[Vi[m]]-(B[Vi[m]]-f)),m==="n"?(k=Math.min(x||1/0,C||1/0),w.bottom=b=ye(b)?Math.min(b,k):k):m==="w"?(k=Math.min(x||1/0,C||1/0),w.right=b=ye(b)?Math.min(b,k):k):m==="s"?(k=Math.max(x||-1/0,C||-1/0),w.top=_=ye(_)?Math.max(_,k):k):m==="e"&&(k=Math.max(x||-1/0,C||-1/0),w.left=_=ye(_)?Math.max(_,k):k));var te=v&&v[S.id];te&&(m==="n"?(k=f+S[di[d]]-te[di[d]],w.bottom=b=ye(b)?Math.min(b,k):k):m==="w"?(k=f+S[di[d]]-te[di[d]],w.right=b=ye(b)?Math.min(b,k):k):m==="s"?(k=f-S[di[d]]+te[di[d]],w.top=_=ye(_)?Math.max(_,k):k):m==="e"&&(k=f-S[di[d]]+te[di[d]],w.left=_=ye(_)?Math.max(_,k):k))}),w}}(c,n,o,r,this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}));return z(t,c,{axis:n,direction:o,spaceToolConstraints:u,start:r}),Os("resize-"+(n==="x"?"ew":"ns")),!0},gn.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],a=[],s=[],c=[];function u(d){o.includes(d)||o.push(d);var m=d.label;m&&!o.includes(m)&&o.push(m)}$(e,function(d){if(d.parent&&!Re(d))if(Fe(d))c.push(d);else{var m=d[t],f=m+d[di[t]];if(function(g){return!!g.host}(d)&&(n>0&&ge(d)[t]>i||n<0&&ge(d)[t]<i))s.push(d);else{var v;if(!(n>0&&m>i||n<0&&f<i))return m<i&&f>i&&r.allowed("shape.resize",{shape:d})?(v=d,void(a.includes(v)||a.push(v))):void 0;u(d)}}}),$(o,function(d){var m=d.attachers;m&&$(m,function(f){u(f)})});var p=o.concat(a);return $(s,function(d){var m=d.host;Sr(p,m)&&u(d)}),p=o.concat(a),$(c,function(d){var m=d.source,f=d.target,v=d.label;Sr(p,m)&&Sr(p,f)&&v&&u(v)}),{movingShapes:o,resizingShapes:a}},gn.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},gn.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^spaceTool/.test(e.prefix)};var td="djs-dragging",wg="djs-resizing",Cl=Math.max;function Sg(e,t,n,i,r){function o(a,s){$(a,function(c){r.addDragger(c,s),n.addMarker(c,td)})}e.on("spaceTool.selection.start",function(a){var s=n.getLayer("space"),c=a.context,u=ue("g");ae(u,i.cls("djs-crosshair-group",["no-events"])),xe(s,u);var p=ue("path");ae(p,"d","M 0,-10000 L 0,10000"),Pe(p).add("djs-crosshair"),xe(u,p);var d=ue("path");ae(d,"d","M -10000,0 L 10000,0"),Pe(d).add("djs-crosshair"),xe(u,d),c.crosshairGroup=u}),e.on("spaceTool.selection.move",function(a){Et(a.context.crosshairGroup,a.x,a.y)}),e.on("spaceTool.selection.cleanup",function(a){var s=a.context.crosshairGroup;s&&dt(s)}),e.on("spaceTool.move",250,function(a){var s=a.context,c=s.line,u=s.axis,p=s.movingShapes,d=s.resizingShapes;if(s.initialized){if(!s.dragGroup){var m=n.getLayer("space");ae(c=ue("path"),"d","M0,0 L0,0"),Pe(c).add("djs-crosshair"),xe(m,c),s.line=c;var f=ue("g");ae(f,i.cls("djs-drag-group",["no-events"])),xe(n.getActiveLayer(),f),o(p,f),o(s.movingConnections=t.filter(function(_){var b=!1;$(p,function(l){$(l.outgoing,function(h){_===h&&(b=!0)})});var w=!1;$(p,function(l){$(l.incoming,function(h){_===h&&(w=!0)})});var S=!1;$(d,function(l){$(l.outgoing,function(h){_===h&&(S=!0)})});var k=!1;return $(d,function(l){$(l.incoming,function(h){_===h&&(k=!0)})}),Fe(_)&&(b||S)&&(w||k)}),f),s.dragGroup=f}if(!s.frameGroup){var v=ue("g");ae(v,i.cls("djs-frame-group",["no-events"])),xe(n.getActiveLayer(),v);var g=[];$(d,function(_){var b=r.addFrame(_,v),w=b.getBBox();g.push({element:b,initialBounds:w}),n.addMarker(_,wg)}),s.frameGroup=v,s.frames=g}ae(c,{d:{x:"M"+a.x+", -10000 L"+a.x+", 10000",y:"M -10000, "+a.y+" L 10000, "+a.y}[u]});var E={x:a.dx,y:a.dy};E[{x:"y",y:"x"}[s.axis]]=0,Et(s.dragGroup,E.x,E.y),$(s.frames,function(_){var b,w,S=_.element,k=_.initialBounds;s.direction==="e"?ae(S,{width:Cl(k.width+E.x,5)}):ae(S,{width:b=Cl(k.width-E.x,5),x:k.x+k.width-b}),s.direction==="s"?ae(S,{height:Cl(k.height+E.y,5)}):ae(S,{height:w=Cl(k.height-E.y,5),y:k.y+k.height-w})})}}),e.on("spaceTool.cleanup",function(a){var s=a.context,c=s.movingShapes,u=s.movingConnections,p=s.resizingShapes,d=s.line,m=s.dragGroup,f=s.frameGroup;$(c,function(v){n.removeMarker(v,td)}),$(u,function(v){n.removeMarker(v,td)}),m&&(dt(d),dt(m)),$(p,function(v){n.removeMarker(v,wg)}),f&&dt(f)})}Sg.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const W1={__init__:["spaceToolPreview"],__depends__:[ci,qn,wl,uo,ma],spaceTool:["type",gn],spaceToolPreview:["type",Sg]};function kl(e){e.invoke(gn,this)}kl.$inject=["injector"],le(kl,gn),kl.prototype.calculateAdjustments=function(e,t,n,i){var r=gn.prototype.calculateAdjustments.call(this,e,t,n,i);return r.resizingShapes=r.resizingShapes.filter(function(o){return!(P(o,"bpmn:TextAnnotation")||function(a){return P(a,"bpmn:Participant")&&!Q(a).processRef}(o)&&(t==="y"&&gt(o)||t==="x"&&!gt(o)))}),r};const Cg={__depends__:[W1],spaceTool:["type",kl]};function Qe(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)}Qe.$inject=["eventBus","injector"],Qe.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";const n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()},Qe.prototype.canExecute=function(e,t){const n={command:e,context:t},i=this._getHandler(e);let r=this._fire(e,"canExecute",n);if(r===void 0){if(!i)return!1;i.canExecute&&(r=i.canExecute(t))}return r},Qe.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})},Qe.prototype.undo=function(){let e,t=this._getUndoAction();if(t){for(this._currentExecution.trigger="undo",this._pushAction(t);t&&(this._internalUndo(t),e=this._getUndoAction(),e&&e.id===t.id);)t=e;this._popAction()}},Qe.prototype.redo=function(){let e,t=this._getRedoAction();if(t){for(this._currentExecution.trigger="redo",this._pushAction(t);t&&(this._internalExecute(t,!0),e=this._getRedoAction(),e&&e.id===t.id);)t=e;this._popAction()}},Qe.prototype.register=function(e,t){this._setHandler(e,t)},Qe.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");const n=this._injector.instantiate(t);this.register(e,n)},Qe.prototype.canUndo=function(){return!!this._getUndoAction()},Qe.prototype.canRedo=function(){return!!this._getRedoAction()},Qe.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Qe.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Qe.prototype._internalUndo=function(e){const 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)})},Qe.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);const i=t?[e+"."+t,t]:[e];let r;n=this._eventBus.createEvent(n);for(const o of i)if(r=this._eventBus.fire("commandStack."+o,n),n.cancelBubble)break;return r},Qe.prototype._createId=function(){return this._uid++},Qe.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Qe.prototype._internalExecute=function(e,t){const n=e.command,i=e.context,r=this._getHandler(n);if(!r)throw new 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()},Qe.prototype._pushAction=function(e){const t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},Qe.prototype._popAction=function(){const e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:Vh("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Qe.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=Ee(e)?e:[e],t.dirty=t.dirty.concat(e))},Qe.prototype._executedAction=function(e,t){const n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},Qe.prototype._revertedAction=function(e){this._stackIdx--},Qe.prototype._getHandler=function(e){return this._handlerMap[e]},Qe.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};const q1={commandStack:["type",Qe]};function $i(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}function nd(e,t,n){Z.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",1400,function(r){var o=r.context,a=o.shapes,s=o.validatedShapes;o.shapes=kg(a),o.validatedShapes=kg(s)}),i&&t.on("shape.move.start",250,function(r){var o=r.context,a=o.shapes,s=[];$(a,function(c){$(c.labels,function(u){u.hidden||o.shapes.indexOf(u)!==-1||s.push(u),c.labelTarget&&s.push(c)})}),$(s,function(c){i.makeDraggable(o,c,!0)})}),this.preExecuted("elements.move",1400,function(r){var o=r.context.closure,a=o.enclosedElements,s=[];$(a,function(c){$(c.labels,function(u){a[u.id]||s.push(u)})}),o.addAll(s)}),this.preExecute(["connection.delete","shape.delete"],function(r){var o=r.context;$i((o.connection||o.shape).labels,function(a){n.removeShape(a,{nested:!0})})}),this.execute("shape.delete",function(r){var o=r.context,a=o.shape,s=a.labelTarget;s&&(o.labelTargetIndex=eu(s.labels,a),o.labelTarget=s,a.labelTarget=null)}),this.revert("shape.delete",function(r){var o=r.context,a=o.shape,s=o.labelTarget,c=o.labelTargetIndex;s&&(ht(s.labels,a,c),a.labelTarget=s)})}function kg(e){return Ce(e,function(t){return e.indexOf(t.labelTarget)===-1})}le(nd,Z),nd.$inject=["injector","eventBus","modeling"];const K1={__init__:["labelSupport"],labelSupport:["type",nd]};var Ag="attach-ok";function id(e,t,n,i,r){Z.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",1401,function(a){var s,c,u=a.context,p=u.shapes,d=u.validatedShapes;u.shapes=(c=rd(s=p),a_("id",s,c)),u.validatedShapes=function(m){var f=zr(m,"id");return Ce(m,function(v){for(;v;){if(v.host&&f[v.host.id])return!1;v=v.parent}return!0})}(d)}),o&&t.on("shape.move.start",251,function(a){var s=a.context;$(rd(s.shapes),function(c){o.makeDraggable(s,c,!0),$(c.labels,function(u){o.makeDraggable(s,u,!0)})})}),o&&t.on("shape.move.start",function(a){var s=a.context.shapes;if(s.length===1){var c=s[0].host;c&&(n.addMarker(c,Ag),t.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(c,Ag)}))}}),this.preExecuted("elements.move",1401,function(a){var s=a.context,c=s.closure;$(rd(s.shapes),function(u){c.add(u,c.topLevel[u.host.id])})}),this.postExecuted("elements.move",function(a){var s=a.context,c=s.shapes,u=s.newHost;u&&c.length!==1||$(u?c:Ce(c,function(p){var d,m=p.host;return function(f){return!!f.host}(p)&&(d=m,c.indexOf(d)===-1)}),function(p){r.updateAttachment(p,u)})}),this.postExecuted("elements.move",function(a){$(a.context.shapes,function(s){$(s.attachers,function(c){$(c.outgoing.slice(),function(u){i.allowed("connection.reconnect",{connection:u,source:u.source,target:u.target})||r.removeConnection(u)}),$(c.incoming.slice(),function(u){i.allowed("connection.reconnect",{connection:u,source:u.source,target:u.target})||r.removeConnection(u)})})})}),this.postExecute("shape.create",function(a){var s=a.context,c=s.shape,u=s.host;u&&r.updateAttachment(c,u)}),this.postExecute("shape.replace",function(a){var s=a.context,c=s.oldShape,u=s.newShape;$i(c.attachers,function(p){i.allowed("elements.move",{target:u,shapes:[p]})==="attach"?r.updateAttachment(p,u):r.removeShape(p)}),u.attachers.length&&$(u.attachers,function(p){var d=Cy(p,c,u);r.moveShape(p,d,p.parent)})}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,u=s.oldBounds,p=s.newBounds,d=c.attachers;(s.hints||{}).attachSupport!==!1&&$(d,function(m){var f=Cy(m,u,p);r.moveShape(m,f,m.parent),$(m.labels,function(v){r.moveShape(v,f,v.parent)})})}),this.preExecute("shape.delete",function(a){var s=a.context.shape;$i(s.attachers,function(c){r.removeShape(c)}),s.host&&r.updateAttachment(s,null)})}function rd(e){return $c(kt(e,function(t){return t.attachers||[]}))}le(id,Z),id.$inject=["injector","eventBus","canvas","rules","modeling"];const X1={__depends__:[qn],__init__:["attachSupport"],attachSupport:["type",id]};function bn(e){this._model=e}function Kt(e,t,n){Z.call(this,e),this._bpmnFactory=t;var i=this;function r(p){$(p.context.oldRoot.children,function(d){P(d,"bpmn:BaseElement")&&i.updateParent(d)})}function o(p){var d=p.context.shape;P(d,"bpmn:BaseElement")&&i.updateBounds(d)}function a(p){i.updateConnection(p.context)}function s(p){i.updateConnectionWaypoints(p.context.connection)}function c(p){i.updateAttachment(p.context)}function u(p){const{element:d}=p.context,m=tn(d),f=Me(d),v=f&&f.get("label");hr(d)||Ps(d)||(m&&!v?f.set("label",t.create("bpmndi:BPMNLabel")):!m&&v&&f.set("label",void 0))}this.executed(["connection.layout","connection.create"],function(p){var d,m=p.context,f=m.hints||{};m.cropped||f.createElementsBehavior===!1||((d=m.connection).waypoints=n.getCroppedWaypoints(d),m.cropped=!0)}),this.reverted(["connection.layout"],function(p){delete p.context.cropped}),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Xt(function(p){var d=p.context;i.updateParent(d.shape||d.connection,d.oldParent)})),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Xt(function(p){var d=p.context,m=d.shape||d.connection,f=d.parent||d.newParent;i.updateParent(m,f)})),this.executed(["canvas.updateRoot"],r),this.reverted(["canvas.updateRoot"],r),this.executed(["shape.move","shape.create","shape.resize"],Xt(function(p){p.context.shape.type!=="label"&&o(p)})),this.reverted(["shape.move","shape.create","shape.resize"],Xt(function(p){p.context.shape.type!=="label"&&o(p)})),e.on("shape.changed",function(p){p.element.type==="label"&&o({context:{shape:p.element}})}),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],Xt(a)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],Xt(a)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],Xt(s)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],Xt(s)),this.executed("connection.reconnect",Xt(function(p){var d=p.context,m=d.connection,f=d.oldSource,v=d.newSource,g=Q(m),E=Q(f),_=Q(v);g.conditionExpression&&!Se(_,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(d.oldConditionExpression=g.conditionExpression,delete g.conditionExpression),f!==v&&E.default===g&&(d.oldDefault=E.default,delete E.default)})),this.reverted("connection.reconnect",Xt(function(p){var d=p.context,m=d.connection,f=d.oldSource,v=d.newSource,g=Q(m),E=Q(f),_=Q(v);d.oldConditionExpression&&(g.conditionExpression=d.oldConditionExpression),d.oldDefault&&(E.default=d.oldDefault,delete _.default)})),this.executed(["element.updateAttachment"],Xt(c)),this.reverted(["element.updateAttachment"],Xt(c)),this.executed("element.updateLabel",Xt(u)),this.reverted("element.updateLabel",Xt(u))}function Xt(e){return function(t){var n=t.context;P(n.shape||n.connection||n.element,"bpmn:BaseElement")&&e(t)}}function Fi(e,t){ti.call(this),this._bpmnFactory=e,this._moddle=t}function od(e,t,n){return t[n]===void 0?t:(e[n]=t[n],cn(t,[n]))}function Al(e,t){this._modeling=e,this._canvas=t}function Tl(e){this._modeling=e}function Pl(e,t){this._canvas=e,this._layouter=t}bn.$inject=["moddle"],bn.prototype._needsId=function(e){return Se(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"])},bn.prototype._ensureId=function(e){var t;e.id?this._model.ids.claim(e.id,e):(t=P(e,"bpmn:Activity")?"Activity":P(e,"bpmn:Event")?"Event":P(e,"bpmn:Gateway")?"Gateway":Se(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e)))},bn.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},bn.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},bn.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",z({bpmnElement:e,bounds:this.createDiBounds()},t))},bn.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},bn.prototype.createDiWaypoints=function(e){var t=this;return kt(e,function(n){return t.createDiWaypoint(n)})},bn.prototype.createDiWaypoint=function(e){return this.create("dc:Point",Pn(e,["x","y"]))},bn.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",z({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))},bn.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",z({bpmnElement:e},t))},le(Kt,Z),Kt.$inject=["eventBus","bpmnFactory","connectionDocking"],Kt.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},Kt.prototype.updateParent=function(e,t){if(!(Re(e)||P(e,"bpmn:DataStoreReference")&&e.parent&&P(e.parent,"bpmn:Collaboration"))){var n=e.parent,i=e.businessObject,r=Me(e),o=n&&n.businessObject,a=Me(n);P(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,o,t&&t.businessObject),P(e,"bpmn:DataOutputAssociation")&&(o=e.source?e.source.businessObject:null),P(e,"bpmn:DataInputAssociation")&&(o=e.target?e.target.businessObject:null),this.updateSemanticParent(i,o),P(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,o),this.updateDiParent(r,a)}},Kt.prototype.updateBounds=function(e){var t=Me(e),n=function(a){if(P(a,"bpmn:Activity")){var s=Me(a);if(s){var c=s.get("label");if(c)return c.get("bounds")}}}(e);if(n){var i=Rn(n,t.get("bounds"));z(n,{x:e.x+i.x,y:e.y+i.y})}var r=Re(e)?this._getLabel(t):t,o=r.bounds;o||(o=this._bpmnFactory.createDiBounds(),r.set("bounds",o)),z(o,{x:e.x,y:e.y,width:e.width,height:e.height})},Kt.prototype.updateFlowNodeRefs=function(e,t,n){n!==t&&(P(n,"bpmn:Lane")&&ot(n.get("flowNodeRef"),e),P(t,"bpmn:Lane")&&ht(t.get("flowNodeRef"),e))},Kt.prototype.updateDiConnection=function(e,t,n){var i=Me(e),r=Me(t),o=Me(n);i.sourceElement&&i.sourceElement.bpmnElement!==Q(t)&&(i.sourceElement=t&&r),i.targetElement&&i.targetElement.bpmnElement!==Q(n)&&(i.targetElement=n&&o)},Kt.prototype.updateDiParent=function(e,t){if(t&&!P(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(ot(n,e),e.$parent=null)}},Kt.prototype.getLaneSet=function(e){var t,n;return P(e,"bpmn:Lane")?((t=e.childLaneSet)||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(P(e,"bpmn:Participant")&&(e=e.processRef),(t=(n=e.get("laneSets"))[0])||((t=this._bpmnFactory.create("bpmn:LaneSet")).$parent=e,n.push(t)),t)},Kt.prototype.updateSemanticParent=function(e,t,n){var i;if(e.$parent!==t&&(!P(e,"bpmn:DataInput")&&!P(e,"bpmn:DataOutput")||(P(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),!("ioSpecification"in t)||t.ioSpecification!==e.$parent))){if(P(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),i="lanes";else if(P(e,"bpmn:FlowElement")){if(t){if(P(t,"bpmn:Participant"))t=t.processRef;else if(P(t,"bpmn:Lane"))do t=t.$parent.$parent;while(P(t,"bpmn:Lane"))}i="flowElements"}else if(P(e,"bpmn:Artifact")){for(;t&&!P(t,"bpmn:Process")&&!P(t,"bpmn:SubProcess")&&!P(t,"bpmn:Collaboration");){if(P(t,"bpmn:Participant")){t=t.processRef;break}t=t.$parent}i="artifacts"}else if(P(e,"bpmn:MessageFlow"))i="messageFlows";else if(P(e,"bpmn:Participant")){i="participants";var r,o=e.processRef;o&&(r=function(c){for(;c&&!P(c,"bpmn:Definitions");)c=c.$parent;return c}(e.$parent||t),e.$parent&&(ot(r.get("rootElements"),o),o.$parent=null),t&&(ht(r.get("rootElements"),o),o.$parent=r))}else P(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":P(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(`no parent for <${e.id}> in <${t.id}>`);var a;if(e.$parent&&ot(a=e.$parent.get(i),e),t?((a=t.get(i)).push(e),e.$parent=t):e.$parent=null,n){var s=n.get(i);ot(a,e),t&&(s||(s=[],t.set(i,s)),s.push(e))}}},Kt.prototype.updateConnectionWaypoints=function(e){Me(e).set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},Kt.prototype.updateConnection=function(e){var t,n=e.connection,i=Q(n),r=n.source,o=Q(r),a=n.target,s=Q(n.target);if(P(i,"bpmn:DataAssociation"))P(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=o,t=e.parent||e.newParent||s,this.updateSemanticParent(i,s,t)):P(i,"bpmn:DataOutputAssociation")&&(t=e.parent||e.newParent||o,this.updateSemanticParent(i,o,t),i.targetRef=s);else{var c=P(i,"bpmn:SequenceFlow");i.sourceRef!==o&&(c&&(ot(i.sourceRef&&i.sourceRef.get("outgoing"),i),o&&o.get("outgoing")&&o.get("outgoing").push(i)),i.sourceRef=o),i.targetRef!==s&&(c&&(ot(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)},Kt.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label},le(Fi,ti),Fi.$inject=["bpmnFactory","moddle"],Fi.prototype._baseCreate=ti.prototype.create,Fi.prototype.create=function(e,t){if(e==="label"){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,z({type:"label",di:n},Wo,t))}return this.createElement(e,t)},Fi.prototype.createElement=function(e,t){var n,i,r,o=(t=z({},t||{})).businessObject,a=t.di;if(!o){if(!t.type)throw new Error("no shape type specified");Zm(o=this._bpmnFactory.create(t.type))}if(!Se(a,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])){var s=z({},a||{},{id:o.id+"_di"});a=e==="root"?this._bpmnFactory.createDiPlane(o,s):e==="connection"?this._bpmnFactory.createDiEdge(o,s):this._bpmnFactory.createDiShape(o,s)}return P(o,"bpmn:Group")&&(t=z({isFrame:!0},t)),(t=function(c,u){return $(["processRef","isInterrupting","associationDirection","isForCompensation"],function(p){u=od(c,u,p)}),u}(o,t)).isExpanded&&(t=od(a,t,"isExpanded")),Se(o,["bpmn:Lane","bpmn:Participant"])&&(t=od(a,t,"isHorizontal")),P(o,"bpmn:SubProcess")&&(t.collapsed=!Ae(o,a)),P(o,"bpmn:ExclusiveGateway")&&(Lt(a,"isMarkerVisible")?a.isMarkerVisible===void 0&&(a.isMarkerVisible=!1):a.isMarkerVisible=!0),xt(t.triggeredByEvent)&&(o.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),xt(t.cancelActivity)&&(o.cancelActivity=t.cancelActivity,delete t.cancelActivity),t.eventDefinitionType&&(i=o.get("eventDefinitions")||[],r=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),t.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(r.condition=this._bpmnFactory.create("bpmn:FormalExpression")),i.push(r),r.$parent=o,o.eventDefinitions=i,delete t.eventDefinitionType),n=this.getDefaultSize(o,a),t=z({id:o.id},n,t,{businessObject:o,di:a}),this._baseCreate(e,t)},Fi.prototype.getDefaultSize=function(e,t){var n=Q(e);if(t=t||Me(e),P(n,"bpmn:SubProcess"))return Ae(n,t)?{width:350,height:200}:{width:100,height:80};if(P(n,"bpmn:Task"))return{width:100,height:80};if(P(n,"bpmn:Gateway"))return{width:50,height:50};if(P(n,"bpmn:Event"))return{width:36,height:36};if(P(n,"bpmn:Participant")){var i=t.isHorizontal===void 0||t.isHorizontal===!0;return Ae(n,t)?i?{width:600,height:250}:{width:250,height:600}:i?{width:400,height:60}:{width:60,height:400}}return P(n,"bpmn:Lane")?{width:400,height:100}:P(n,"bpmn:DataObjectReference")?{width:36,height:50}:P(n,"bpmn:DataStoreReference")?{width:50,height:50}:P(n,"bpmn:TextAnnotation")?{width:100,height:30}:P(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},Fi.prototype.createParticipantShape=function(e){return vt(e)||(e={isExpanded:e}),(e=z({type:"bpmn:Participant"},e||{})).isExpanded!==!1&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)},Al.$inject=["modeling","canvas"],Al.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;$(n,function(r){var o={x:0,y:0};xt(i.left)?o.x=i.left-r.x:xt(i.right)?o.x=i.right-r.width-r.x:xt(i.center)?o.x=i.center-Math.round(r.width/2)-r.x:xt(i.top)?o.y=i.top-r.y:xt(i.bottom)?o.y=i.bottom-r.height-r.y:xt(i.middle)&&(o.y=i.middle-Math.round(r.height/2)-r.y),t.moveElements([r],o,r.parent)})},Al.prototype.postExecute=function(e){},Tl.$inject=["modeling"],Tl.prototype.preExecute=function(e){var t=e.source;if(!t)throw new 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},Tl.prototype.postExecute=function(e){var t,n,i=e.hints||{};t=e.source,n=e.shape,Gt(t.outgoing,function(r){return r.target===n})||(i.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))},Pl.$inject=["canvas","layouter"],Pl.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 new Error("source and target required");if(!r)throw new 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},Pl.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var Rl=Math.round;function ad(e){this._modeling=e}ad.$inject=["modeling"],ad.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,a=this._modeling;$(t,function(p){ye(p.x)||(p.x=0),ye(p.y)||(p.y=0)});var s=yt(Ce(t,function(p){return!p.hidden}));$(t,function(p){Fe(p)&&(p.waypoints=kt(p.waypoints,function(d){return{x:Rl(d.x-s.x-s.width/2+r.x),y:Rl(d.y-s.y-s.height/2+r.y)}})),z(p,{x:Rl(p.x-s.x-s.width/2+r.x),y:Rl(p.y-s.y-s.height/2+r.y)})});var c=ls(t),u={};$(t,function(p){if(Fe(p))u[p.id]=ye(i)?a.createConnection(u[p.source.id],u[p.target.id],i,p,p.parent||n,o):a.createConnection(u[p.source.id],u[p.target.id],p,p.parent||n,o);else{var d=z({},o);c.indexOf(p)===-1&&(d.autoResize=!1),Re(p)&&(d=cn(d,["attach"])),u[p.id]=ye(i)?a.createShape(p,Pn(p,["x","y","width","height"]),p.parent||n,i,d):a.createShape(p,Pn(p,["x","y","width","height"]),p.parent||n,d)}}),e.elements=Fc(u)};var Tg=Math.round;function zi(e){this._canvas=e}function ya(e){zi.call(this,e)}zi.$inject=["canvas"],zi.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent,r=e.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?z(t,n):z(t,{x:n.x-Tg(t.width/2),y:n.y-Tg(t.height/2)}),this._canvas.addShape(t,i,r),t},zi.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t},le(ya,zi),ya.$inject=["canvas"];var Y1=zi.prototype.execute;ya.prototype.execute=function(e){var t=e.shape;return function(n){["width","height"].forEach(function(i){n[i]===void 0&&(n[i]=0)})}(t),t.labelTarget=e.labelTarget,Y1.call(this,e)};var J1=zi.prototype.revert;function ga(e,t){this._canvas=e,this._modeling=t}function sd(e,t){this._modeling=e,this._elementRegistry=t}function ba(e,t){this._canvas=e,this._modeling=t}function Ml(e){this._modeling=e}ya.prototype.revert=function(e){return e.shape.labelTarget=null,J1.call(this,e)},ga.$inject=["canvas","modeling"],ga.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;$i(n.incoming,function(i){t.removeConnection(i,{nested:!0})}),$i(n.outgoing,function(i){t.removeConnection(i,{nested:!0})})},ga.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=eu(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},ga.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,ht(n.children,t,i),this._canvas.addConnection(t,n),t},sd.$inject=["modeling","elementRegistry"],sd.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry;$(e.elements,function(i){n.get(i.id)&&(i.waypoints?t.removeConnection(i):t.removeShape(i))})},ba.$inject=["canvas","modeling"],ba.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;$i(n.incoming,function(i){t.removeConnection(i,{nested:!0})}),$i(n.outgoing,function(i){t.removeConnection(i,{nested:!0})}),$i(n.children,function(i){Fe(i)?t.removeConnection(i,{nested:!0}):t.removeShape(i,{nested:!0})})},ba.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=eu(i.children,n),t.removeShape(n),n},ba.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return ht(i.children,n,r),t.addShape(n,i),n},Ml.$inject=["modeling"];var Pg={x:"y",y:"x"};function Nl(e,t){this._layouter=e,this._canvas=t}function ld(){}function cd(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function xa(e){this._modeling=e}function Il(e){this._helper=new xa(e)}function Cr(e){this._modeling=e,this._helper=new xa(e)}function _a(e){this._modeling=e}function Rg(e){return e.original||e}function hi(e,t){this._modeling=e,this._rules=t}function Ea(e){this._modeling=e}function Ui(e){this._modeling=e}function Mg(e){return z({},e)}function Ng(e){switch(e){case"n":case"s":return"y";case"w":case"e":return"x"}}function Ig(e,t,n){var i=Ng(n);return/e|s/.test(n)?e[i]>t:/n|w/.test(n)?e[i]<t:void 0}function Hi(e,t){return e.indexOf(t)!==-1}function Bl(e){this._modeling=e}function Bg(e){var t={};return $(e,function(n){t[n.id]=n.hidden,n.children&&(t=z({},t,Bg(n.children)))}),t}function Dg(e,t){var n=[];return $(e,function(i){i.hidden=t,n=n.concat(i),i.children&&(n=n.concat(Dg(i.children,i.collapsed||t)))}),n}function Og(e,t){var n=[];return $(e,function(i){i.hidden=t[i.id],n=n.concat(i),i.children&&(n=n.concat(Og(i.children,t)))}),n}function Dl(e){this._modeling=e}function Lg(e,t){return ot(e&&e.attachers,t)}function jg(e,t,n){if(e){var i=e.attachers;i||(e.attachers=i=[]),ht(i,t,n)}}function ud(){}function $e(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var i=this;e.on("diagram.init",function(){i.registerHandlers(n)})}function wa(e){this._elementRegistry=e}function Vg(e,t){$(t,function(n,i){e.set(i,n)})}Ml.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,i=e.axis,r=e.dimension;function o(g,E){g.range.min=Math.min(E[i],g.range.min),g.range.max=Math.max(E[i]+E[r],g.range.max)}function a(g){return g[i]+g[r]/2}function s(g){return g.length-1}function c(g){return g.max-g.min}var u,p,d=n[0],m=s(n),f=n[m],v=0;$(n,function(g,E){var _,b,w;g.elements.length<2?E&&E!==n.length-1&&(o(g,g.elements[0]),v+=c(g.range)):(b=(_=$n(g.elements,i))[0],E===m&&(b=_[s(_)]),w=a(b),g.range=null,$(_,function(S){(function(k,l){var h={y:0};h[i]=k-a(l),h[i]&&(h[Pg[i]]=0,t.moveElements([l],h,l.parent))})(w,S),g.range!==null?o(g,S):g.range={min:S[i],max:S[i]+S[r]}}),E&&E!==n.length-1&&(v+=c(g.range)))}),p=Math.abs(f.range.min-d.range.max),(u=Math.round((p-v)/(n.length-1)))<n.length-1||$(n,function(g,E){var _,b={};g!==d&&g!==f&&(_=n[E-1],g.range.max=0,$(g.elements,function(w,S){b[Pg[i]]=0,b[i]=_.range.max-w[i]+u,g.range.min!==w[i]&&(b[i]+=w[i]-g.range.min),b[i]&&t.moveElements([w],b,w.parent),g.range.max=Math.max(w[i]+w[r],S?g.range.max:0)}))})},Ml.prototype.postExecute=function(e){},Nl.$inject=["layouter","canvas"],Nl.prototype.execute=function(e){var t=e.connection;return z(e,{oldWaypoints:t.waypoints}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},Nl.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t},ld.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=ot(o.children,t),ht(i.children,t,r),t.parent=i,$(t.waypoints,function(a){a.x+=n.x,a.y+=n.y,a.original&&(a.original.x+=n.x,a.original.y+=n.y)}),t},ld.prototype.revert=function(e){var t=e.connection,n=t.parent,i=e.oldParent,r=e.oldParentIndex,o=e.delta;return ot(n.children,t),ht(i.children,t,r),t.parent=i,$(t.waypoints,function(a){a.x-=o.x,a.y-=o.y,a.original&&(a.original.x-=o.x,a.original.y-=o.y)}),t},cd.prototype.add=function(e,t){return this.addAll([e],t)},cd.prototype.addAll=function(e,t){var n=function(i,r,o){or(r)&&(r=!0),vt(r)&&(o=r,r=!0);var a=Lo((o=o||{}).allShapes),s=Lo(o.allConnections),c=Lo(o.enclosedElements),u=Lo(o.enclosedConnections),p=Lo(o.topLevel,r&&zr(i,function(m){return m.id}));function d(m){p[m.source.id]&&p[m.target.id]&&(p[m.id]=[m]),a[m.source.id]&&a[m.target.id]&&(u[m.id]=c[m.id]=m),s[m.id]=m}return lr(i,function(m){if(c[m.id]=m,!m.waypoints)return a[m.id]=m,$(m.incoming,d),$(m.outgoing,d),m.children;u[m.id]=s[m.id]=m}),{allShapes:a,allConnections:s,topLevel:p,enclosedConnections:u,enclosedElements:c}}(e,!!t,this);return z(this,n),this},xa.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},xa.prototype.moveClosure=function(e,t,n,i,r){var o=this._modeling,a=e.allShapes,s=e.allConnections,c=e.enclosedConnections,u=e.topLevel,p=!1;r&&r.parent===n&&(p=!0),$(a,function(d){o.moveShape(d,t,u[d.id]&&!p&&n,{recurse:!1,layout:!1})}),$(s,function(d){var m=!!a[d.source.id],f=!!a[d.target.id];c[d.id]&&m&&f?o.moveConnection(d,t,u[d.id]&&!p&&n):o.layoutConnection(d,{connectionStart:m&&wp(d,d.source,t),connectionEnd:f&&Sp(d,d.target,t)})})},xa.prototype.getClosure=function(e){return new cd().addAll(e,!0)},Il.$inject=["modeling"],Il.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},Il.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)},Cr.$inject=["modeling"],Cr.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=Pn(t,["x","y","width","height"]),e.oldParent=o,e.oldParentIndex=ot(o.children,t),ht(i.children,t,r),z(t,{parent:i,x:t.x+n.x,y:t.y+n.y}),t},Cr.prototype.postExecute=function(e){var t=e.shape,n=e.delta,i=e.hints,r=this._modeling;i.layout!==!1&&($(t.incoming,function(o){r.layoutConnection(o,{connectionEnd:Sp(o,t,n)})}),$(t.outgoing,function(o){r.layoutConnection(o,{connectionStart:wp(o,t,n)})})),i.recurse!==!1&&this.moveChildren(e)},Cr.prototype.revert=function(e){var t=e.shape,n=e.oldParent,i=e.oldParentIndex,r=e.delta;return ht(n.children,t,i),z(t,{parent:n,x:t.x-r.x,y:t.y-r.y}),t},Cr.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},Cr.prototype.getNewParent=function(e){return e.newParent||e.shape.parent},_a.$inject=["modeling"],_a.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,i=e.connection,r=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return Ee(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},_a.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),o.layoutConnection!==!1&&(!n||i&&o.docking!=="source"||(a.connectionStart=a.connectionStart||Rg(Ee(r)?r[0]:r)),!i||n&&o.docking!=="target"||(a.connectionEnd=a.connectionEnd||Rg(Ee(r)?r[r.length-1]:r)),o.newWaypoints&&(a.waypoints=o.newWaypoints),this._modeling.layoutConnection(t,a))},_a.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},hi.$inject=["modeling","rules"],hi.prototype.preExecute=function(e){var t,n=this,i=this._modeling,r=this._rules,o=e.oldShape,a=e.newData,s=e.hints||{};function c(v,g,E){return r.allowed("connection.reconnect",{connection:E,source:v,target:g})}var u,p={x:a.x,y:a.y},d={x:o.x,y:o.y,width:o.width,height:o.height};t=e.newShape=e.newShape||n.createShape(a,p,o.parent,s),o.host&&i.updateAttachment(t,o.host),s.moveChildren!==!1&&(u=o.children.slice(),i.moveElements(u,{x:0,y:0},t,s));var m=o.incoming.slice(),f=o.outgoing.slice();$(m,function(v){c(v.source,t,v)&&n.reconnectEnd(v,t,dl(v,t,d),s)}),$(f,function(v){var g=v.target;c(t,g,v)&&n.reconnectStart(v,t,pl(v,t,d),s)})},hi.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},hi.prototype.execute=function(e){},hi.prototype.revert=function(e){},hi.prototype.createShape=function(e,t,n,i){return this._modeling.createShape(e,t,n,i)},hi.prototype.reconnectStart=function(e,t,n,i){this._modeling.reconnectStart(e,t,n,i)},hi.prototype.reconnectEnd=function(e,t,n,i){this._modeling.reconnectEnd(e,t,n,i)},Ea.$inject=["modeling"],Ea.prototype.execute=function(e){var t=e.shape,n=e.newBounds,i=e.minBounds;if(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)throw new Error("newBounds must have {x, y, width, height} properties");if(i&&(n.width<i.width||n.height<i.height))throw new Error("width and height cannot be less than minimum height and width");if(!i&&n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},z(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},Ea.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,i=e.oldBounds;(e.hints||{}).layout!==!1&&($(n.incoming,function(r){t.layoutConnection(r,{connectionEnd:dl(r,n,i)})}),$(n.outgoing,function(r){t.layoutConnection(r,{connectionStart:pl(r,n,i)})}))},Ea.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return z(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},Ui.$inject=["modeling"],Ui.prototype.preExecute=function(e){var t=e.delta,n=e.direction,i=e.movingShapes,r=e.resizingShapes,o=e.start,a={};this.moveShapes(i,t),$(r,function(s){a[s.id]=function(c){return{x:c.x,y:c.y,height:c.height,width:c.width}}(s)}),this.resizeShapes(r,t,n),this.updateConnectionWaypoints(function(s,c){var u=[];return $(s.concat(c),function(p){var d=p.incoming,m=p.outgoing;$(d.concat(m),function(f){var v=f.source,g=f.target;(va(s,v)||va(s,g)||va(c,v)||va(c,g))&&(va(u,f)||u.push(f))})}),u}(i,r),t,n,o,i,r,a)},Ui.prototype.execute=function(){},Ui.prototype.revert=function(){},Ui.prototype.moveShapes=function(e,t){var n=this;$(e,function(i){n._modeling.moveShape(i,t,null,{autoResize:!1,layout:!1,recurse:!1})})},Ui.prototype.resizeShapes=function(e,t,n){var i=this;$(e,function(r){var o=function(a,s,c){var u=a.x,p=a.y,d=a.width,m=a.height,f=c.x,v=c.y;switch(s){case"n":return{x:u,y:p+v,width:d,height:m-v};case"s":return{x:u,y:p,width:d,height:m+v};case"w":return{x:u+f,y:p,width:d-f,height:m};case"e":return{x:u,y:p,width:d+f,height:m};default:throw new Error("unknown direction: "+s)}}(r,n,t);i._modeling.resizeShape(r,o,null,{attachSupport:!1,autoResize:!1,layout:!1})})},Ui.prototype.updateConnectionWaypoints=function(e,t,n,i,r,o,a){var s=this,c=r.concat(o);$(e,function(u){var p=u.source,d=u.target,m=function(g){return kt(g.waypoints,function(E){return(E=Mg(E)).original&&(E.original=Mg(E.original)),E})}(u),f=Ng(n),v={};Hi(c,p)&&Hi(c,d)?(m=kt(m,function(g){return Ig(g,i,n)&&(g[f]=g[f]+t[f]),g.original&&Ig(g.original,i,n)&&(g.original[f]=g.original[f]+t[f]),g}),s._modeling.updateWaypoints(u,m,{labelBehavior:!1})):(Hi(c,p)||Hi(c,d))&&(Hi(r,p)?v.connectionStart=wp(u,p,t):Hi(r,d)?v.connectionEnd=Sp(u,d,t):Hi(o,p)?v.connectionStart=pl(u,p,a[p.id]):Hi(o,d)&&(v.connectionEnd=dl(u,d,a[d.id])),s._modeling.layoutConnection(u,v))})},Bl.$inject=["modeling"],Bl.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=Bg(n),t.collapsed=!t.collapsed;var i=Dg(n,t.collapsed);return[t].concat(i)},Bl.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,i=Og(t.children,n);return t.collapsed=!t.collapsed,[t].concat(i)},Dl.$inject=["modeling"],Dl.prototype.execute=function(e){var t=e.shape,n=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=Lg(i,t),jg(n,t),t.host=n,t},Dl.prototype.revert=function(e){var t=e.shape,n=e.newHost,i=e.oldHost,r=e.attacherIdx;return t.host=i,Lg(n,t),jg(i,t,r),t},ud.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},ud.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t},$e.$inject=["eventBus","elementFactory","commandStack"],$e.prototype.getHandlers=function(){return{"shape.append":Tl,"shape.create":zi,"shape.delete":ba,"shape.move":Cr,"shape.resize":Ea,"shape.replace":hi,"shape.toggleCollapse":Bl,spaceTool:Ui,"label.create":ya,"connection.create":Pl,"connection.delete":ga,"connection.move":ld,"connection.layout":Nl,"connection.updateWaypoints":ud,"connection.reconnect":_a,"elements.create":ad,"elements.move":Il,"elements.delete":sd,"elements.distribute":Ml,"elements.align":Al,"element.updateAttachment":Dl}},$e.prototype.registerHandlers=function(e){$(this.getHandlers(),function(t,n){e.registerHandler(n,t)})},$e.prototype.moveShape=function(e,t,n,i,r){typeof i=="object"&&(r=i,i=null);var o={shape:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)},$e.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},$e.prototype.moveElements=function(e,t,n,i){var r,o=(i=i||{}).attach,a=n;o===!0?(r=n,a=n.parent):o===!1&&(r=null);var s={shapes:e,delta:t,newParent:a,newHost:r,hints:i};this._commandStack.execute("elements.move",s)},$e.prototype.moveConnection=function(e,t,n,i,r){typeof i=="object"&&(r=i,i=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)},$e.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},$e.prototype.createConnection=function(e,t,n,i,r,o){typeof n=="object"&&(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},$e.prototype.createShape=function(e,t,n,i,r){typeof i!="number"&&(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},$e.prototype.createElements=function(e,t,n,i,r){Ee(e)||(e=[e]),typeof i!="number"&&(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},$e.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},$e.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},$e.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},$e.prototype.distributeElements=function(e,t,n){var i={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",i)},$e.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},$e.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},$e.prototype.replaceShape=function(e,t,n){var i={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},$e.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},$e.prototype.resizeShape=function(e,t,n,i){var r={shape:e,newBounds:t,minBounds:n,hints:i};this._commandStack.execute("shape.resize",r)},$e.prototype.createSpace=function(e,t,n,i,r){var o={delta:n,direction:i,movingShapes:e,resizingShapes:t,start:r};this._commandStack.execute("spaceTool",o)},$e.prototype.updateWaypoints=function(e,t,n){var i={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},$e.prototype.reconnect=function(e,t,n,i,r){var o={connection:e,newSource:t,newTarget:n,dockingOrPoints:i,hints:r||{}};this._commandStack.execute("connection.reconnect",o)},$e.prototype.reconnectStart=function(e,t,n,i){i||(i={}),this.reconnect(e,t,e.target,n,z(i,{docking:"source"}))},$e.prototype.reconnectEnd=function(e,t,n,i){i||(i={}),this.reconnect(e,e.source,t,n,z(i,{docking:"target"}))},$e.prototype.connect=function(e,t,n,i){return this.createConnection(e,t,n||{},e.parent,i)},$e.prototype._create=function(e,t){return t instanceof Gr?t:this._elementFactory.create(e,t)},$e.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)},wa.$inject=["elementRegistry"],wa.prototype.execute=function(e){var t=e.element,n=e.moddleElement,i=e.properties;if(!n)throw new Error("<moddleElement> required");var r=e.changed||this._getVisualReferences(n).concat(t),o=e.oldProperties||function(a,s){return Ht(s,function(c,u){return c[u]=a.get(u),c},{})}(n,Za(i));return Vg(n,i),e.oldProperties=o,e.changed=r,r},wa.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return Vg(n,t),i},wa.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return P(e,"bpmn:DataObject")?function(n,i){return i.filter(function(r){return P(r,"bpmn:DataObjectReference")&&Q(r).dataObjectRef===n})}(e,t):[]};var Sa="default",mi="id",Z1={width:0,height:0};function Ca(e,t,n,i){this._elementRegistry=e,this._moddle=t,this._modeling=n,this._textRenderer=i}function $g(e,t){return mi in e&&e[mi]!==t[mi]}function Fg(e,t){var n=e.businessObject,i=Me(e);$(t,function(r,o){o!=="di"?n.set(o,r):i&&function(a,s){$(s,function(c,u){a.set(u,c)})}(i,r)})}Ca.$inject=["elementRegistry","moddle","modeling","textRenderer"],Ca.prototype.execute=function(e){var t=e.element,n=[t];if(!t)throw new Error("element required");var i=this._elementRegistry,r=this._moddle.ids,o=t.businessObject,a=function(c){var u=z({},c);return Q1.forEach(function(p){p in c&&(u[p]=Q(u[p]))}),u}(e.properties),s=e.oldProperties||function(c,u){var p=Za(u),d=c.businessObject,m=Me(c);return Ht(p,function(f,v){return f[v]=v!=="di"?d.get(v):function(g,E){return Ht(E,function(_,b){return _[b]=g&&g.get(b),_},{})}(m,Za(u.di)),f},{})}(t,a);return $g(a,o)&&(r.unclaim(o[mi]),i.updateId(t,a[mi]),r.claim(a[mi],o)),Sa in a&&(a[Sa]&&n.push(i.get(a[Sa].id)),o[Sa]&&n.push(i.get(o[Sa].id))),Fg(t,a),e.oldProperties=s,e.changed=n,n},Ca.prototype.postExecute=function(e){var t=e.element.label,n=t&&Q(t).name;if(n){var i=this._textRenderer.getExternalLabelBounds(t,n);this._modeling.resizeShape(t,i,Z1)}},Ca.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 Fg(t,i),$g(n,r)&&(a.unclaim(n[mi]),o.updateId(t,i[mi]),a.claim(i[mi],r)),e.changed};var Q1=["default"];function Ol(e,t){this._canvas=e,this._modeling=t}function pd(e,t){this._modeling=e,this._spaceTool=t}function dd(e){this._modeling=e}function ka(e,t){this._modeling=e,this._spaceTool=t}Ol.$inject=["canvas","modeling"],Ol.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,a=o.$parent,s=Me(r);return t.setRootElement(n),t.removeRootElement(r),ht(a.rootElements,i),i.$parent=a,ot(a.rootElements,o),o.$parent=null,r.di=null,s.bpmnElement=i,n.di=s,e.oldRoot=r,[]},Ol.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=e.oldRoot,o=r.businessObject,a=i.$parent,s=Me(n);return t.setRootElement(r),t.removeRootElement(n),ot(a.rootElements,i),i.$parent=null,ht(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,r.di=s,[]},pd.$inject=["modeling","spaceTool"],pd.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=yn(i),a=o===i,s=a?i:i.parent,c=pi(s),u=gt(i);if(u?r==="left"?r="top":r==="right"&&(r="bottom"):r==="top"?r="left":r==="bottom"&&(r="right"),!c.length){var p=u?{x:i.x+vn,y:i.y,width:i.width-vn,height:i.height}:{x:i.x,y:i.y+vn,width:i.width,height:i.height-vn};n.createShape({type:"bpmn:Lane",isHorizontal:u},p,s)}var d,m,f,v,g,E=[];lr(o,function(S){return E.push(S),S.label&&E.push(S.label),S===i?[]:Ce(S.children,function(k){return k!==i})}),r==="top"?(d=-120,f=(m=i.y)+10,v="n",g="y"):r==="left"?(d=-120,f=(m=i.x)+10,v="w",g="x"):r==="bottom"?(d=120,f=(m=i.y+i.height)-10,v="s",g="y"):r==="right"&&(d=120,f=(m=i.x+i.width)-10,v="e",g="x");var _=t.calculateAdjustments(E,g,d,f),b=u?{x:0,y:d}:{x:d,y:0};t.makeSpace(_.movingShapes,_.resizingShapes,b,v,f);var w=u?{x:i.x+(a?vn:0),y:m-(r==="top"?120:0),width:i.width-(a?vn:0),height:120}:{x:m-(r==="left"?120:0),y:i.y+(a?vn:0),width:120,height:i.height-(a?vn:0)};e.newLane=n.createShape({type:"bpmn:Lane",isHorizontal:u},w,s)},dd.$inject=["modeling"],dd.prototype.preExecute=function(e){var t=this._modeling,n=e.shape,i=e.count,r=pi(n),o=r.length;if(o>i)throw new Error(`more than <${i}> child lanes`);var a,s,c,u,p=gt(n),d=p?n.height:n.width,m=Math.round(d/i);for(u=0;u<i;u++)a=u===i-1?d-m*u:m,s=p?{x:n.x+vn,y:n.y+u*m,width:n.width-vn,height:a}:{x:n.x+u*m,y:n.y+vn,width:a,height:n.height-vn},u<o?t.resizeShape(r[u],s):(c={type:"bpmn:Lane",isHorizontal:p},t.createShape(c,s,n))},ka.$inject=["modeling","spaceTool"],ka.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds;e.balanced!==!1?this.resizeBalanced(t,n):this.resizeSpace(t,n)},ka.prototype.resizeBalanced=function(e,t){var n=this._modeling,i=function(r,o){var a=yn(r),s=sl(a,P(a,"bpmn:Process")?[]:[a]),c=de(r),u=de(o),p=function(f,v){return ly(de(v),de(f))}(r,o),d=[],m=gt(r);return s.forEach(function(f){if(f!==r){var v,g,E=m?0:p.top,_=m?p.right:0,b=m?0:p.bottom,w=m?p.left:0,S=de(f);p.top&&(Oi(S.bottom-c.top)<10&&(b=u.top-S.bottom),Oi(S.top-c.top)<5&&(E=u.top-S.top)),p.left&&(Oi(S.right-c.left)<10&&(_=u.left-S.right),Oi(S.left-c.left)<5&&(w=u.left-S.left)),p.bottom&&(Oi(S.top-c.bottom)<10&&(E=u.bottom-S.top),Oi(S.bottom-c.bottom)<5&&(b=u.bottom-S.bottom)),p.right&&(Oi(S.left-c.right)<10&&(w=u.right-S.left),Oi(S.right-c.right)<5&&(_=u.right-S.right)),(E||_||b||w)&&d.push({shape:f,newBounds:(v=f,g={top:E,right:_,bottom:b,left:w},{x:v.x+(g.left||0),y:v.y+(g.top||0),width:v.width-(g.left||0)+(g.right||0),height:v.height-(g.top||0)+(g.bottom||0)})})}}),d}(e,t);n.resizeShape(e,t),i.forEach(function(r){n.resizeShape(r.shape,r.newBounds)})},ka.prototype.resizeSpace=function(e,t){var n,i,r,o,a,s=this._spaceTool,c=de(e),u=ly(de(t),c),p=yn(e),d=[],m=[];lr(p,function(f){return d.push(f),(P(f,"bpmn:Lane")||P(f,"bpmn:Participant"))&&m.push(f),f.children}),(u.bottom||u.top)&&(n=u.bottom||u.top,i=e.y+(u.bottom?e.height:0)+(u.bottom?-10:10),r=u.bottom?"s":"n",o=u.top>0||u.bottom<0?-n:n,a=s.calculateAdjustments(d,"y",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:0,y:n},r)),(u.left||u.right)&&(n=u.right||u.left,i=e.x+(u.right?e.width:0)+(u.right?-10:100),r=u.right?"e":"w",o=u.left>0||u.right<0?-n:n,a=s.calculateAdjustments(m,"x",o,i),s.makeSpace(a.movingShapes,a.resizingShapes,{x:n,y:0},r))};var Aa="flowNodeRef",hd="lanes";function Ta(e){this._elementRegistry=e}function Ll(e){this._moddle=e}Ta.$inject=["elementRegistry"],Ta.prototype._computeUpdates=function(e,t){var n=[],i=[],r={},o=[];function a(s){n.indexOf(s)===-1&&(o.push(s),n.push(s))}return t.forEach(function(s){var c=yn(s);if(c&&n.indexOf(c)===-1){var u=c.children.filter(function(p){return P(p,"bpmn:FlowNode")});u.forEach(a),n.push(c)}}),e.forEach(a),o.forEach(function(s){var c=s.businessObject,u=c.get(hd).slice(),p=function(d){if(!d.parent)return[];var m=function(f){var v=yn(f);return r[v.id]||(r[v.id]=sl(v)),r[v.id]}(d);return m.filter(function(f){return v=d,g=de(f),E=v.x+v.width/2,_=v.y+v.height/2,E>g.left&&E<g.right&&_>g.top&&_<g.bottom;var v,g,E,_}).map(function(f){return f.businessObject})}(s);i.push({flowNode:c,remove:u,add:p})}),t.forEach(function(s){var c=s.businessObject;s.parent||c.get(Aa).forEach(function(u){i.push({flowNode:u,remove:[c],add:[]})})}),i},Ta.prototype.execute=function(e){var t=e.updates;return t||(t=e.updates=this._computeUpdates(e.flowNodeShapes,e.laneShapes)),t.forEach(function(n){var i=n.flowNode,r=i.get(hd);n.remove.forEach(function(o){ot(r,o),ot(o.get(Aa),i)}),n.add.forEach(function(o){ht(r,o),ht(o.get(Aa),i)})}),[]},Ta.prototype.revert=function(e){return e.updates.forEach(function(t){var n=t.flowNode,i=n.get(hd);t.add.forEach(function(r){ot(i,r),ot(r.get(Aa),n)}),t.remove.forEach(function(r){ht(i,r),ht(r.get(Aa),n)})}),[]},Ll.$inject=["moddle"],Ll.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),[]},Ll.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 ew={fill:void 0,stroke:void 0};function md(e){this._commandStack=e,this._normalizeColor=function(t){if(t){if(Ut(t)){var n=function(i){var r=document.createElement("canvas").getContext("2d");return r.fillStyle="transparent",r.fillStyle=i,/^#[0-9a-fA-F]{6}$/.test(r.fillStyle)?r.fillStyle:null}(t);if(n)return n}throw new Error(`invalid color value: ${t}`)}}}md.$inject=["commandStack"],md.prototype.postExecute=function(e){var t=e.elements,n=e.colors||ew,i=this,r={};"fill"in n&&z(r,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&z(r,{"border-color":this._normalizeColor(n.stroke)}),$(t,function(o){var a=Fe(o)?Pn(r,["border-color"]):r,s=Me(o);if(function(c){"border-color"in c&&(c.stroke=c["border-color"]),"background-color"in c&&(c.fill=c["background-color"])}(a),Re(o))i._commandStack.execute("element.updateModdleProperties",{element:o,moddleElement:s.label,properties:{color:r["border-color"]}});else{if(!Se(s,["bpmndi:BPMNEdge","bpmndi:BPMNShape"]))return;i._commandStack.execute("element.updateProperties",{element:o,properties:{di:a}})}})};var tw={width:0,height:0};function zg(e,t,n){function i(r,o){var a=r.label||r,s=r.labelTarget||r;return function(c,u){var p=c.businessObject,d=of(p);d&&(d==="categoryValueRef"?p.categoryValueRef.value=u:p[d]=u)}(a,o),[a,s]}this.preExecute=function(r){var o=r.element,a=o.businessObject,s=r.newLabel;if(!Re(o)&&hr(o)&&!ws(o)&&!Ug(s)){var c=gu(o);c={x:c.x,y:c.y+7},e.createLabel(o,c,{id:a.id+"_label",businessObject:a,di:o.di})}},this.execute=function(r){return r.oldLabel=tn(r.element),i(r.element,r.newLabel)},this.revert=function(r){return i(r.element,r.oldLabel)},this.postExecute=function(r){var o=r.element,a=o.label||o,s=r.newLabel,c=r.newBounds,u=r.hints||{};if(Re(a)||P(a,"bpmn:TextAnnotation"))if(Re(a)&&Ug(s))u.removeShape!==!1&&e.removeShape(a,{unsetLabel:!1});else{var p=tn(o);c===void 0&&(c=t.getExternalLabelBounds(a,p)),c&&e.resizeShape(a,c,tw)}}}function Ug(e){return!e||!e.trim()}function Rt(e,t,n,i){$e.call(this,e,t,n),this._bpmnRules=i}function Hg(){}zg.$inject=["modeling","textRenderer","bpmnFactory"],le(Rt,$e),Rt.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],Rt.prototype.getHandlers=function(){var e=$e.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=wa,e["element.updateProperties"]=Ca,e["canvas.updateRoot"]=Ol,e["lane.add"]=pd,e["lane.resize"]=ka,e["lane.split"]=dd,e["lane.updateRefs"]=Ta,e["id.updateClaim"]=Ll,e["element.setColor"]=md,e["element.updateLabel"]=zg,e},Rt.prototype.updateLabel=function(e,t,n,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:i||{}})},Rt.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)},Rt.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},Rt.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},Rt.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},Rt.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane},Rt.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},Rt.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},Rt.prototype.makeProcess=function(){var e=this._create("root",{type:"bpmn:Process"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},Rt.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},Rt.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},Rt.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},Rt.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})},Hg.prototype.layoutConnection=function(e,t){return[(t=t||{}).connectionStart||ge(t.source||e.source),t.connectionEnd||ge(t.target||e.target)]};var jl=Math.round,nw={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function Gg(e,t,n){var i,r,o,a=Tt(t,e,5),s=n.split(":")[0],c=jl((t.x-e.x)/2+e.x),u=jl((t.y-e.y)/2+e.y),p=(o=a,{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[s].test(o)),d=/h|r|l/.test(s),m=!1,f=!1;return p?(i=d?{x:c,y:e.y}:{x:e.x,y:u},r=d?"h:h":"v:v"):(m=function(v,g){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[g].test(v)}(a,s),r=d?"h:v":"v:h",m?d?(f=u===e.y,i={x:e.x+20*(/l/.test(s)?-1:1),y:f?u+20:u}):i={x:(f=c===e.x)?c+20:c,y:e.y+20*(/t/.test(s)?-1:1)}:i={x:c,y:u}),{waypoints:fd(e,i,r).concat(i),directions:r,turnNextDirections:f}}function Wg(e){return e.split(":").reverse().join(":")}function fd(e,t,n){if(!function(a){return a&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(a)}(n=n||"h:h"))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(Kg(n)){var i=function(a,s,c){return Gg(a,s,c)}(e,t,n),r=function(a,s,c){var u=Gg(s,a,Wg(c));return{waypoints:u.waypoints.slice().reverse(),directions:Wg(u.directions),turnNextDirections:u.turnNextDirections}}(e,t,n),o=function(a,s){var c=a.directions.split(":")[1],u=s.directions.split(":")[0];a.turnNextDirections&&(c=c=="h"?"v":"h"),s.turnNextDirections&&(u=u=="h"?"v":"h");var p=c+":"+u;return{waypoints:fd(a.waypoints[a.waypoints.length-1],s.waypoints[0],p),directions:p}}(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return function(a,s,c){var u=jl((s.x-a.x)/2+a.x),p=jl((s.y-a.y)/2+a.y);if(c==="h:v")return[{x:s.x,y:a.y}];if(c==="v:h")return[{x:a.x,y:s.y}];if(c==="h:h")return[{x:u,y:a.y},{x:u,y:s.y}];if(c==="v:v")return[{x:a.x,y:p},{x:s.x,y:p}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}(e,t,n)}function iw(e,t,n,i,r){var o=function(p,d){if(or(p))return[];(function(f){if(!Ee(f))throw new Error("must supply array")})(p);const m=Qa(d);return p.filter(function(f,v){return!m(f,v)})}(r&&r.preferredLayouts||[],"straight")[0]||"h:h",a=Tt(e,t,nw[o]||0),s=function(p,d){if(Kg(d))return d;switch(p){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return d}}(a,o);n=n||ge(e),i=i||ge(t);var c=s.split(":"),u=Xg(n,e,c[0],function(p){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[p]}(a));return function(p,d,m){var f=fd(p,d,m);return f.unshift(p),f.push(d),Yg(f)}(u,Xg(i,t,c[1],a),s)}function qg(e,t,n){return function(i,r,o){return i>=r&&i<=o}(t[e],n[e],n[e]+n[{x:"width",y:"height"}[e]])}function vd(e,t,n,i){if(function(s){return s.length<3||!(s.length>4)&&!!Be(s,function(c,u){var p=s[u-1];return p&&jo(c,p)<3})}(i))return null;var r,o=i[0],a=i.slice();return a[0]=n,a[1]=function(s,c,u){switch(ei(c,s)){case"v":return{x:u.x,y:s.y};case"h":return{x:s.x,y:u.y}}return{x:s.x,y:s.y}}(a[1],o,n),r=function(s,c,u){var p;for(p=s.length-2;p!==0;p--)if(sm(s[p],c,20)||sm(s[p],u,20))return s.slice(p);return s}(a,e,t),r!==a&&(a=vd(e,t,n,r)),a&&ei(a)?null:a}function Kg(e){return e&&/t|r|b|l/.test(e)}function Xg(e,t,n,i){if(n==="h"&&(n=/left/.test(i)?"l":"r"),n==="v"&&(n=/top/.test(i)?"t":"b"),n==="t")return{original:e,x:e.x,y:t.y};if(n==="r")return{original:e,x:t.x+t.width,y:e.y};if(n==="b")return{original:e,x:e.x,y:t.y+t.height};if(n==="l")return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function Yg(e){return e.reduce(function(t,n,i){return tu(t[t.length-1],e[i+1],n,0)||t.push(n),t},[])}var rw={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},ow={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},yd={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},Pa={top:"t",right:"r",bottom:"b",left:"l"};function Vl(e){this._elementRegistry=e}function aw(e,t){return P(t,"bpmn:Participant")?"source":P(e,"bpmn:Participant")?"target":Ra(t)?"source":Ra(e)||P(t,"bpmn:Event")?"target":P(e,"bpmn:Event")?"source":null}function sw(e){return Ra(e)?"target":"source"}function Jg(e,t){return e?e.original||e:ge(t)}function Zg(e,t){return P(t,"bpmn:Activity")&&P(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function Ra(e){return P(e,"bpmn:SubProcess")&&Ae(e)}function kr(e,t){return e===t}function go(e){var t=/right|left/.exec(e);return t&&t[0]}function bo(e){var t=/top|bottom/.exec(e);return t&&t[0]}function Qg(e,t){return yd[e]===t}function e0(e){return e==="right"||e==="left"}function lw(e,t,n){var i=t.waypoints,r=i&&i.length&&Tt(i[0],e);return r==="top"?n.loop.fromTop:r==="right"?n.loop.fromRight:r==="left"?n.loop.fromLeft:n.loop.fromBottom}function cw(e,t,n,i){var r,o,a,s,c=ge(e),u=ge(t),p=(s=(a=e).host,Tt(ge(a),s,-10)),d=kr(e.host,t),m=["top","right","bottom","left"].indexOf(p)!==-1,f=Tt(u,c,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return d?function(v,g,E,_,b,w){var S=g?v:w.isHorizontal?bo(v):go(v);return[Pa[S]+":"+(g?e0(v)?t0("y",E,_,b)?"h":w.boundaryLoop.alternateHorizontalSide:t0("x",E,_,b)?"v":w.boundaryLoop.alternateVerticalSide:w.boundaryLoop.default)]}(p,m,e,t,n,i):(r=function(v,g,E,_){if(E)return Pa[v];var b=bo(v),w=go(v),S=bo(g),k=go(g);if(_){if(kr(b,S)||Qg(w,k))return Pa[b]}else if(kr(w,k)||Qg(b,S))return Pa[w];return Pa[_?w:b]}(p,f,m,i.isHorizontal),o=function(v,g,E,_){return E?e0(v)?function(b,w){var S=go(b),k=yd[S];return w.indexOf(k)!==-1}(v,g)||kr(v,g)?"h":"v":function(b,w){var S=bo(b),k=yd[S];return w.indexOf(k)!==-1}(v,g)||kr(v,g)?"v":"h":_?kr(bo(v),bo(g))?"h":"v":kr(go(v),go(g))?"v":"h"}(p,f,m,i.isHorizontal),[r+":"+o])}function t0(e,t,n,i){return!(gd(e,i,n,40)||gd(e,i,{x:n.x+n.width,y:n.y+n.height},40)||gd(e,i,ge(t),40))}function gd(e,t,n,i){return Math.abs(t[e]-n[e])<i}function n0(e){return z({original:e.point.original||e.point},e.actual)}function Gi(e,t){this._elementRegistry=e,this._graphicsFactory=t}le(Vl,Hg),Vl.prototype.layoutConnection=function(e,t){t||(t={});var n,i,r=t.source||e.source,o=t.target||e.target,a=t.waypoints||e.waypoints,s=t.connectionStart,c=t.connectionEnd,u=this._elementRegistry;if(s||(s=Jg(a&&a[0],r)),c||(c=Jg(a&&a[a.length-1],o)),(P(e,"bpmn:Association")||P(e,"bpmn:DataAssociation"))&&a&&!Zg(r,o))return[].concat([s],a.slice(1,-1),[c]);var p=xv(r,u)?rw:ow;return P(e,"bpmn:MessageFlow")?n=function(d,m,f){return{preferredLayouts:f.messageFlow,preserveDocking:aw(d,m)}}(r,o,p):(P(e,"bpmn:SequenceFlow")||Zg(r,o))&&(n=r===o?{preferredLayouts:lw(r,e,p)}:P(r,"bpmn:BoundaryEvent")?{preferredLayouts:cw(r,o,c,p)}:Ra(r)||Ra(o)?{preferredLayouts:p.subProcess,preserveDocking:sw(r)}:P(r,"bpmn:Gateway")?{preferredLayouts:p.fromGateway}:P(o,"bpmn:Gateway")?{preferredLayouts:p.toGateway}:{preferredLayouts:p.default}),n&&(i=Yg(function(d,m,f,v,g,E){var _;return Ee(f)&&(g=f,E=v,f=ge(d),v=ge(m)),g=g||[],_=(E=z({preferredLayouts:[]},E)).preferredLayouts.indexOf("straight")!==-1&&function(b,w,S,k,l){var h,y,x={};return y=Tt(b,w),/^(top|bottom|left|right)$/.test(y)?(/top|bottom/.test(y)&&(h="x"),/left|right/.test(y)&&(h="y"),l.preserveDocking==="target"?qg(h,k,b)?(x[h]=k[h],[{x:x.x!==void 0?x.x:S.x,y:x.y!==void 0?x.y:S.y,original:{x:x.x!==void 0?x.x:S.x,y:x.y!==void 0?x.y:S.y}},{x:k.x,y:k.y}]):null:qg(h,S,w)?(x[h]=S[h],[{x:S.x,y:S.y},{x:x.x!==void 0?x.x:k.x,y:x.y!==void 0?x.y:k.y,original:{x:x.x!==void 0?x.x:k.x,y:x.y!==void 0?x.y:k.y}}]):null):null}(d,m,f,v,E),_||(_=E.connectionEnd&&function(b,w,S,k){var l=k.slice().reverse();return(l=vd(b,w,S,l))?l.reverse():null}(m,d,v,g),_||(_=E.connectionStart&&vd(d,m,f,g))||(!E.connectionStart&&!E.connectionEnd&&g&&g.length?g:iw(d,m,f,v,E)))}(r,o,s,c,a,n=z(n,t)))),i||[s,c]},Vl.$inject=["elementRegistry"],Gi.$inject=["elementRegistry","graphicsFactory"],Gi.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(n0(i)),o.push(n0(r)),o},Gi.prototype.getDockingPoint=function(e,t,n){var i,r,o=e.waypoints;return{point:r=o[i=n?0:o.length-1],actual:this._getIntersection(t,e,n)||r,idx:i}},Gi.prototype._getIntersection=function(e,t,n){return ou(this._getShapePath(e),this._getConnectionPath(t),n)},Gi.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},Gi.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},Gi.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};const i0={__init__:["modeling","bpmnUpdater"],__depends__:[I1,D1,O1,L1,bg,q1,K1,X1,Gn,xu,Cg],bpmnFactory:["type",bn],bpmnUpdater:["type",Kt],elementFactory:["type",Fi],modeling:["type",Rt],layouter:["type",Vl],connectionDocking:["type",Gi]},r0=Math.round;function $l(e,t,n,i,r,o){this._complexPreview=e,this._connectionDocking=t,this._elementFactory=n,this._eventBus=i,this._layouter=r,this._rules=o}$l.prototype.create=function(e,t,n){const i=this._complexPreview,r=this._connectionDocking,o=this._elementFactory,a=this._eventBus,s=this._layouter,c=this._rules,u=o.createShape(z({type:t},n)),p=a.fire("autoPlace",{source:e,shape:u});if(!p)return;z(u,{x:p.x-r0(u.width/2),y:p.y-r0(u.height/2)});const d=c.allowed("connection.create",{source:e,target:u,hints:{targetParent:e.parent}});let m=null;d&&(m=o.createConnection(d),m.waypoints=s.layoutConnection(m,{source:e,target:u}),m.waypoints=r.getCroppedWaypoints(m,e,u)),i.create({created:[u,m].filter(f=>!Io(f))})},$l.prototype.cleanUp=function(){this._complexPreview.cleanUp()},$l.$inject=["complexPreview","connectionDocking","elementFactory","eventBus","layouter","rules"];const uw={__depends__:[Ku,v1,i0],__init__:["appendPreview"],appendPreview:["type",$l]};var o0=Math.min,a0=Math.max;function bd(e){e.preventDefault()}function Ma(e){e.stopPropagation()}function Nn(e){this.container=e.container,this.parent=He('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=Ve("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=jt(this.autoResize,this),this.handlePaste=jt(this.handlePaste,this)}function xn(e,t){this._eventBus=e,this._canvas=t,this._providers=[],this._textbox=new Nn({container:t.getContainer(),keyHandler:jt(this._handleKey,this),resizeHandler:jt(this._handleResize,this)})}Nn.prototype.create=function(e,t,n,i){var r=this.parent,o=this.content,a=this.container;i=this.options=i||{};var s=Pn(t=this.style=t||{},["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);z(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=Pn(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return z(o.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},c),i.centerVertically&&z(o.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},c),o.innerText=n,ve.bind(o,"keydown",this.keyHandler),ve.bind(o,"mousedown",Ma),ve.bind(o,"paste",this.handlePaste),i.autoResize&&ve.bind(o,"input",this.autoResize),i.resizable&&this.resizable(t),a.appendChild(r),this.setSelection(o.lastChild,o.lastChild&&o.lastChild.length),r},Nn.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)}},Nn.prototype.insertText=function(e){e=e.replace(/\r\n|\r|\n/g,`
  204. `),document.execCommand("insertText",!1,e)||this._insertTextIE(e)},Nn.prototype._insertTextIE=function(e){var t,n,i,r=this.getSelection(),o=r.startContainer,a=r.endContainer,s=r.startOffset,c=r.endOffset,u=r.commonAncestorContainer,p=(t=u.childNodes,[].slice.call(t));if(function(g){return g.nodeType===Node.TEXT_NODE}(u)){var d=o.textContent;o.textContent=d.substring(0,s)+e+d.substring(c),n=o,i=s+e.length}else if(o===this.content&&a===this.content){var m=document.createTextNode(e);this.content.insertBefore(m,p[s]),n=m,i=m.textContent.length}else{var f=p.indexOf(o),v=p.indexOf(a);p.forEach(function(g,E){E===f?g.textContent=o.textContent.substring(0,s)+e+a.textContent.substring(c):E>f&&E<=v&&Fn(g)}),n=o,i=s+e.length}n&&i!==void 0&&setTimeout(function(){self.setSelection(n,i)})},Nn.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})}},Nn.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){var s,c,u,p;n=this.resizeHandle=He('<div class="djs-direct-editing-resize-handle"></div>');var d=function(f){bd(f),Ma(f);var v=o0(a0(u+f.clientX-s,i),o),g=o0(a0(p+f.clientY-c,r),a);t.style.width=v+"px",t.style.height=g+"px",e.resizeHandler({width:u,height:p,dx:f.clientX-s,dy:f.clientY-c})},m=function(f){bd(f),Ma(f),ve.unbind(document,"mousemove",d,!1),ve.unbind(document,"mouseup",m,!1)};ve.bind(n,"mousedown",function(f){bd(f),Ma(f),s=f.clientX,c=f.clientY;var v=t.getBoundingClientRect();u=v.width,p=v.height,ve.bind(document,"mousemove",d),ve.bind(document,"mouseup",m)})}z(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)},Nn.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),ve.unbind(t,"keydown",this.keyHandler),ve.unbind(t,"mousedown",Ma),ve.unbind(t,"input",this.autoResize),ve.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),Fn(n)),Fn(e)},Nn.prototype.getValue=function(){return this.content.innerText.trim()},Nn.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},Nn.prototype.setSelection=function(e,t){var n=document.createRange();e===null?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)},xn.$inject=["eventBus","canvas"],xn.prototype.registerProvider=function(e){this._providers.push(e)},xn.prototype.isActive=function(e){return!(!this._active||e&&this._active.element!==e)},xn.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},xn.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},xn.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0,this._canvas.restoreFocus&&this._canvas.restoreFocus()},xn.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()}},xn.prototype.getValue=function(){return this._textbox.getValue()},xn.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;return t===27?(e.preventDefault(),this.cancel()):t!==13||e.shiftKey?void 0:(e.preventDefault(),this.complete())},xn.prototype._handleResize=function(e){this._fire("resize",e)},xn.prototype.activate=function(e){var t;this.isActive()&&this.cancel();var n=Be(this._providers,function(i){return(t=i.activate(e))?i: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};const s0={__depends__:[Bs],__init__:["directEditing"],directEditing:["type",xn]};function l0(e){return function(t){var n=t.target,i=Q(e),r=i.eventDefinitions&&i.eventDefinitions[0],o=i.$type===n.type,a=(r&&r.$type)===n.eventDefinitionType,s=!!n.triggeredByEvent==!!i.triggeredByEvent,c=n.isExpanded===void 0||n.isExpanded===Ae(e);return!(o&&a&&s&&c)}}var pw=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],dw=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],hw=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link intermediate catch event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link intermediate throw event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],mw=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel end event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate end event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],fw=[{label:"Exclusive gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event-based gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],vw=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],c0=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],yw=c0,u0=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"User task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Service task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Send task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"Manual task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business rule task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Script task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub-process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}}],gw=[{label:"Data store reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],bw=[{label:"Data object reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],xw=[{label:"Message boundary event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!0}},{label:"Timer boundary event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!0}},{label:"Escalation boundary event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!0}},{label:"Conditional boundary event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!0}},{label:"Error boundary event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",cancelActivity:!0}},{label:"Cancel boundary event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition",cancelActivity:!0}},{label:"Signal boundary event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!0}},{label:"Compensation boundary event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",cancelActivity:!0}},{label:"Message boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],_w=[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!0}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!0}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!0}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!0}},{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",isInterrupting:!0}},{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!0}},{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",isInterrupting:!0}},{label:"Message start event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer start event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional start event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal start event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation start event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],Ew=[{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"}],ww=[{label:"Expanded pool/participant",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty pool/participant";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}];const Sw=`
  205. <svg viewBox="0 0 2048 2048" xmlns="http://www.w3.org/2000/svg">
  206. <g transform="translate(0 995.64)">
  207. <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"/>
  208. </g>
  209. </svg>`,Cw=`
  210. <svg viewBox="0 0 2048 2048" xmlns="http://www.w3.org/2000/svg">
  211. <g transform="translate(0 995.64)" fill="none" stroke="currentColor" stroke-linecap="round">
  212. <circle cx="1024" cy="28.357" r="875" stroke-dasharray="418.310422, 361.2328165" stroke-width="100"/>
  213. <circle cx="1024" cy="28.357" r="685" stroke-dasharray="348.31044857,261.23283643" stroke-dashoffset="500" stroke-width="100"/>
  214. </g>
  215. </svg>`;function rn(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()}rn.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate","moddleCopy"],rn.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},rn.prototype.getPopupMenuEntries=function(e){var t=e.businessObject,n=this._rules,i=[];if(Ee(e)||!n.allowed("shape.replace",{element:e}))return{};var r=l0(e);return P(t,"bpmn:DataObjectReference")?this._createEntries(e,gw):P(t,"bpmn:DataStoreReference")&&!P(e.parent,"bpmn:Collaboration")?this._createEntries(e,bw):P(t,"bpmn:StartEvent")&&!P(t.$parent,"bpmn:SubProcess")?(i=Ce(pw,r),this._createEntries(e,i)):P(t,"bpmn:Participant")?(i=Ce(ww,function(o){return Ae(e)!==o.target.isExpanded}),this._createEntries(e,i)):P(t,"bpmn:StartEvent")&&wt(t.$parent)?(i=Ce(_w,function(o){var a=o.target.isInterrupting!==!1,s=t.isInterrupting===a;return r(o)||!r(o)&&!s}),this._createEntries(e,i)):P(t,"bpmn:StartEvent")&&!wt(t.$parent)&&P(t.$parent,"bpmn:SubProcess")?(i=Ce(dw,r),this._createEntries(e,i)):P(t,"bpmn:EndEvent")?(i=Ce(mw,function(o){return!(o.target.eventDefinitionType=="bpmn:CancelEventDefinition"&&!P(t.$parent,"bpmn:Transaction"))&&r(o)}),this._createEntries(e,i)):P(t,"bpmn:BoundaryEvent")?(i=Ce(xw,function(o){var a=o.target;if(a.eventDefinitionType=="bpmn:CancelEventDefinition"&&!P(t.attachedToRef,"bpmn:Transaction"))return!1;var s=a.cancelActivity!==!1,c=t.cancelActivity==s;return r(o)||!r(o)&&!c}),this._createEntries(e,i)):P(t,"bpmn:IntermediateCatchEvent")||P(t,"bpmn:IntermediateThrowEvent")?(i=Ce(hw,r),this._createEntries(e,i)):P(t,"bpmn:Gateway")?(i=Ce(fw,r),this._createEntries(e,i)):P(t,"bpmn:Transaction")?(i=Ce(c0,r),this._createEntries(e,i)):wt(t)&&Ae(e)?(i=Ce(yw,r),this._createEntries(e,i)):P(t,"bpmn:SubProcess")&&Ae(e)?(i=Ce(vw,r),this._createEntries(e,i)):P(t,"bpmn:AdHocSubProcess")&&!Ae(e)?(i=Ce(u0,function(o){var a=o.target,s=a.type==="bpmn:SubProcess",c=a.isExpanded===!0;return l0(a)&&(!s||c)}),this._createEntries(e,i)):P(t,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,Ew):P(t,"bpmn:FlowNode")?(i=Ce(u0,r),P(t,"bpmn:SubProcess")&&!Ae(e)&&(i=Ce(i,function(o){return o.label!=="Sub-process (collapsed)"})),this._createEntries(e,i)):{}},rn.prototype.getPopupMenuHeaderEntries=function(e){var t={};return P(e,"bpmn:Activity")&&!wt(e)&&(t={...t,...this._getLoopCharacteristicsHeaderEntries(e)}),P(e,"bpmn:DataObjectReference")&&(t={...t,...this._getCollectionHeaderEntries(e)}),P(e,"bpmn:Participant")&&(t={...t,...this._getParticipantMultiplicityHeaderEntries(e)}),!P(e,"bpmn:SubProcess")||P(e,"bpmn:Transaction")||wt(e)||(t={...t,...this._getAdHocHeaderEntries(e)}),Ry(e)&&(t={...t,...this._getNonInterruptingHeaderEntries(e)}),t},rn.prototype._createEntries=function(e,t){var n={},i=this;return $(t,function(r){n[r.actionName]=i._createEntry(r,e)}),n},rn.prototype._createSequenceFlowEntries=function(e,t){var n=Q(e),i={},r=this._modeling,o=this._moddle,a=this;return $(t,function(s){switch(s.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(P(n.sourceRef,"bpmn:ExclusiveGateway")||P(n.sourceRef,"bpmn:InclusiveGateway")||P(n.sourceRef,"bpmn:ComplexGateway")||P(n.sourceRef,"bpmn:Activity"))&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){r.updateProperties(e.source,{default:n})})});break;case"replace-with-conditional-flow":!n.conditionExpression&&P(n.sourceRef,"bpmn:Activity")&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){var c=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(e,{conditionExpression:c})})});break;default:P(n.sourceRef,"bpmn:Activity")&&n.conditionExpression&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){r.updateProperties(e,{conditionExpression:void 0})})}),(P(n.sourceRef,"bpmn:ExclusiveGateway")||P(n.sourceRef,"bpmn:InclusiveGateway")||P(n.sourceRef,"bpmn:ComplexGateway")||P(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){r.updateProperties(e.source,{default:void 0})})})}}),i},rn.prototype._createEntry=function(e,t,n){var i=this._translate,r=this._bpmnReplace.replaceElement,o=e.label;return o&&typeof o=="function"&&(o=o(t)),n=n||function(){return r(t,e.target)},{label:i(o),className:e.className,action:n}},rn.prototype._getLoopCharacteristicsHeaderEntries=function(e){var t=this,n=this._translate;function i(c,u){if(u.active)return void t._modeling.updateProperties(e,{loopCharacteristics:void 0});const p=e.businessObject.get("loopCharacteristics"),d=t._moddle.create(u.options.loopCharacteristics);p&&t._moddleCopy.copyElement(p,d),d.set("isSequential",u.options.isSequential),t._modeling.updateProperties(e,{loopCharacteristics:d})}var r,o,a,s=Q(e).loopCharacteristics;return s&&(r=s.isSequential,o=s.isSequential===void 0,a=s.isSequential!==void 0&&!s.isSequential),{"toggle-parallel-mi":{className:"bpmn-icon-parallel-mi-marker",title:n("Parallel multi-instance"),active:a,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},"toggle-sequential-mi":{className:"bpmn-icon-sequential-mi-marker",title:n("Sequential multi-instance"),active:r,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},"toggle-loop":{className:"bpmn-icon-loop-marker",title:n("Loop"),active:o,action:i,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}}},rn.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(o,a){t._modeling.updateModdleProperties(e,i,{isCollection:!a.active})}}}},rn.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(o,a){var s;a.active||(s=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:s})}}}},rn.prototype._getAdHocHeaderEntries=function(e){var t=this._translate,n=P(Q(e),"bpmn:AdHocSubProcess"),i=this._bpmnReplace.replaceElement;return{"toggle-adhoc":{className:"bpmn-icon-ad-hoc-marker",title:t("Ad-hoc"),active:n,action:function(r,o){return i(e,n?{type:"bpmn:SubProcess"}:{type:"bpmn:AdHocSubProcess"},{autoResize:!1,layoutConnection:!1})}}}},rn.prototype._getNonInterruptingHeaderEntries=function(e){const t=this._translate,n=Q(e),i=this,r=My(e),o=P(e,"bpmn:BoundaryEvent")?Cw:Sw,a=!n[r];return{"toggle-non-interrupting":{imageHtml:o,title:t("Toggle non-interrupting"),active:a,action:function(){i._modeling.updateProperties(e,{[r]:!!a})}}}};const kw={__depends__:[Hu,bg,Ku],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",rn]};function Na(e,t,n,i,r,o,a,s,c,u,p,d,m){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=u,this._rules=p,this._translate=d,this._eventBus=n,this._appendPreview=m,e.autoPlace!==!1&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,function(f){var v=f.context.shape;if(Jo(f)&&i.isOpen(v)){var g=i.getEntries(v);g.replace&&g.replace.action.click(f,v)}}),n.on("contextPad.close",function(){m.cleanUp()})}function p0(e,t,n){var i=e.$instanceOf(t),r=!1;return $(e.eventDefinitions||[],function(o){o.$type===n&&(r=!0)}),i&&r}Na.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","appendPreview"],Na.prototype.getMultiElementContextPadEntries=function(e){var t=this._modeling,n={};return this._isDeleteAllowed(e)&&z(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Delete"),action:{click:function(i,r){t.removeElements(r.slice())}}}}),n},Na.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return Ee(t)?ar(e,n=>t.includes(n)):t},Na.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,u=this._appendPreview,p={};if(e.type==="label")return this._isDeleteAllowed([e])&&z(p,v()),p;var d=e.businessObject;function m(b,w){r.start(b,w)}function f(b,w){n.removeElements([w])}function v(){return{delete:{group:"edit",className:"bpmn-icon-trash",title:c("Delete"),action:{click:f}}}}function g(b,w,S,k){function l(x,C){var N=i.createShape(z({type:b},k));o.start(x,N,{source:C})}var h=s?function(x,C){var N=i.createShape(z({type:b},k));s.append(C,N)}:l,y=s?function(x,C){return u.create(C,b,k),()=>{u.cleanUp()}}:null;return{group:"model",className:w,title:S,action:{dragstart:l,click:h,hover:y}}}function E(b){return function(w,S){n.splitLane(S,b),t.open(S,!0)}}if(Se(d,["bpmn:Lane","bpmn:Participant"])&&Ae(e)){var _=pi(e);z(p,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:c("Add lane above"),action:{click:function(b,w){n.addLane(w,"top")}}}}),_.length<2&&((gt(e)?e.height>=120:e.width>=120)&&z(p,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:c("Divide into two lanes"),action:{click:E(2)}}}),(gt(e)?e.height>=180:e.width>=180)&&z(p,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:c("Divide into three lanes"),action:{click:E(3)}}})),z(p,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:c("Add lane below"),action:{click:function(b,w){n.addLane(w,"bottom")}}}})}return P(d,"bpmn:FlowNode")&&(P(d,"bpmn:EventBasedGateway")?z(p,{"append.receive-task":g("bpmn:ReceiveTask","bpmn-icon-receive-task",c("Append receive task")),"append.message-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",c("Append message intermediate catch event"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",c("Append timer intermediate catch event"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",c("Append conditional intermediate catch event"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",c("Append signal intermediate catch event"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):p0(d,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?z(p,{"append.compensation-activity":g("bpmn:Task","bpmn-icon-task",c("Append compensation activity"),{isForCompensation:!0})}):P(d,"bpmn:EndEvent")||d.isForCompensation||p0(d,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||wt(d)||z(p,{"append.end-event":g("bpmn:EndEvent","bpmn-icon-end-event-none",c("Append end event")),"append.gateway":g("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",c("Append gateway")),"append.append-task":g("bpmn:Task","bpmn-icon-task",c("Append task")),"append.intermediate-event":g("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",c("Append intermediate/boundary event"))})),a.isEmpty(e,"bpmn-replace")||z(p,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:c("Change element"),action:{click:function(b,w){var S=z(function(k){var l=t.getPad(k).html.getBoundingClientRect();return{x:l.left,y:l.bottom+5}}(w),{cursor:{x:b.x,y:b.y}});a.open(w,"bpmn-replace",S,{title:c("Change element"),width:300,search:!0})}}}}),P(d,"bpmn:SequenceFlow")&&z(p,{"append.text-annotation":g("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),Se(d,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(p,{"append.text-annotation":g("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:m,dragstart:m}}}),P(d,"bpmn:TextAnnotation")&&z(p,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using association"),action:{click:m,dragstart:m}}}),Se(d,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(p,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using data input association"),action:{click:m,dragstart:m}}}),P(d,"bpmn:Group")&&z(p,{"append.text-annotation":g("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),this._isDeleteAllowed([e])&&z(p,v()),p};const Aw={__depends__:[uw,s0,Vf,Gn,ip,_l,kw],__init__:["contextPadProvider"],contextPadProvider:["type",Na]};var Tw={horizontal:["x","width"],vertical:["y","height"]};function fi(e,t){this._modeling=e,this._filters=[],this.registerFilter(function(n){var i=t.allowed("elements.distribute",{elements:n});return Ee(i)?i:i?n:[]})}fi.$inject=["modeling","rules"],fi.prototype.registerFilter=function(e){if(typeof e!="function")throw new Error("the filter has to be a function");this._filters.push(e)},fi.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},fi.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,r=[].concat(e);return t.length?($(t,function(o){r=o(r,n,i)}),r):e},fi.prototype._createGroups=function(e){var t=[],n=this,i=this._axis,r=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');return $($n(e,i),function(o,a){var s,c=n._findRange(o,i,r),u=t[t.length-1];u&&n._hasIntersection(u.range,c)?t[t.length-1].elements.push(o):(s={range:c,elements:[o]},t.push(s))}),t},fi.prototype._setOrientation=function(e){var t=Tw[e];this._axis=t[0],this._dimension=t[1]},fi.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)},fi.prototype._findRange=function(e){var t=e[this._axis];return{min:t+5,max:t+e[this._dimension]-5}};const Pw={__init__:["distributeElements"],distributeElements:["type",fi]};function Fl(e){mn.call(this,e)}Fl.$inject=["eventBus"],le(Fl,mn),Fl.prototype.init=function(){this.addRule("elements.distribute",function(e){var t=e.elements;return!((t=ls(t=Ce(t,function(n){var i=Se(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||i)}))).length<3)&&t})};var Rw=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
  216. <polyline points="450 400 450 150 1350 150 1350 400" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/>
  217. <rect x="150" y="450" width="600" height="1200" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  218. <rect x="1050" y="450" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  219. </svg>`,Mw=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
  220. <polyline points="400 1350 150 1350 150 450 400 450" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/>
  221. <rect x="450" y="150" width="1200" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
  222. <rect x="450" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>
  223. </svg>`;function Ia(e,t,n,i){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",900,this)}Ia.$inject=["popupMenu","distributeElements","translate","rules"],Ia.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&z(t,this._getEntries(e)),t},Ia.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})},Ia.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:Rw,action:function(r,o){t.trigger(e,"horizontal"),i.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:Mw,action:function(r,o){t.trigger(e,"vertical"),i.close()}}}};const Nw={__depends__:[Hu,Pw],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",Fl],distributeElementsMenuProvider:["type",Ia]};var d0="is not a registered action";function _n(e,t){this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}function xd(e,t){return new Error(e+" "+t)}_n.$inject=["eventBus","injector"],_n.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),u=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&i&&this.register("copy",function(){var p=i.get();if(p.length)return o.copy(p)}),o&&this.register("paste",function(){o.paste()}),r&&this.register("stepZoom",function(p){r.stepZoom(p.value)}),a&&this.register("zoom",function(p){a.zoom(p.value)}),n&&i&&s&&this.register("removeSelection",function(){var p=i.get();if(p.length){var d,m=s.allowed("elements.delete",{elements:p});m!==!1&&(d=Ee(m)?m:p).length&&n.removeElements(d.slice())}}),c&&this.register("moveCanvas",function(p){c.moveCanvas(p)}),u&&this.register("moveSelection",function(p){u.moveSelection(p.direction,p.accelerated)})},_n.prototype.trigger=function(e,t){if(!this._actions[e])throw xd(e,d0);return this._actions[e](t)},_n.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);$(e,function(i,r){n._registerAction(r,i)})},_n.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw xd(e,"is already registered");this._actions[e]=t},_n.prototype.unregister=function(e){if(!this.isRegistered(e))throw xd(e,d0);this._actions[e]=void 0},_n.prototype.getActions=function(){return Object.keys(this._actions)},_n.prototype.isRegistered=function(e){return!!this._actions[e]};const Iw={__init__:["editorActions"],editorActions:["type",_n]};function zl(e){e.invoke(_n,this)}le(zl,_n),zl.$inject=["injector"],zl.prototype._registerDefaultActions=function(e){_n.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),u=e.get("alignElements",!1),p=e.get("directEditing",!1),d=e.get("searchPad",!1),m=e.get("modeling",!1),f=e.get("contextPad",!1);t&&n&&i&&this._registerAction("selectElements",function(){var v=t.getRootElement(),g=n.filter(function(E){return E!==v});return i.select(g),g}),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(v){var g=i.get(),E=v.type;g.length&&c.trigger(g,E)}),i&&u&&this._registerAction("alignElements",function(v){var g=i.get(),E=[],_=v.type;g.length&&(E=Ce(g,function(b){return!P(b,"bpmn:Lane")}),u.trigger(E,_))}),i&&m&&this._registerAction("setColor",function(v){var g=i.get();g.length&&m.setColor(g,v)}),i&&p&&this._registerAction("directEditing",function(){var v=i.get();v.length&&p.activate(v[0])}),d&&this._registerAction("find",function(){d.toggle()}),t&&m&&this._registerAction("moveToOrigin",function(){var v,g,E=t.getRootElement();v=yt(g=P(E,"bpmn:Collaboration")?n.filter(function(_){return P(_.parent,"bpmn:Collaboration")}):n.filter(function(_){return _!==E&&!P(_.parent,"bpmn:SubProcess")})),m.moveElements(g,{x:-v.x,y:-v.y},E)}),i&&f&&this._registerAction("replaceElement",function(v){f.triggerEntry("replace","click",v)})};const Bw={__depends__:[Iw],editorActions:["type",zl]};function h0(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context;Se(t.shape,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}function _d(e,t,n){return n||(n="round"),Math[n](e/t)*t}function Wi(e,t,n){var i=!n||n.active!==!1;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(o){var a=o.originalEvent;if(!(!r.active||a&&nn(a))){var s=o.context,c=s.gridSnappingContext;c||(c=s.gridSnappingContext={}),["x","y"].forEach(function(u){var p={},d=function(f,v,g){var E=f.context,_=f.shape,b=E.gridSnappingContext,w=b.snapLocation,S=b.snapOffset;return S&&ye(S[v])?S[v]:(S||(S=b.snapOffset={}),ye(S[v])||(S[v]=0),_?(g.get(_.id)||(Ul(v)?S[v]+=_[v]+_.width/2:S[v]+=_[v]+_.height/2),w&&(v==="x"?/left/.test(w)?S[v]-=_.width/2:/right/.test(w)&&(S[v]+=_.width/2):/top/.test(w)?S[v]-=_.height/2:/bottom/.test(w)&&(S[v]+=_.height/2)),S[v]):S[v])}(o,u,e);d&&(p.offset=d);var m=function(f,v){var g=f.context,E=g.createConstraints,_=g.resizeConstraints||{},b=g.gridSnappingContext,w=b.snapConstraints;if(w&&w[v])return w[v];w||(w=b.snapConstraints={}),w[v]||(w[v]={});var S=g.direction;E&&(Ul(v)?(w.x.min=E.left,w.x.max=E.right):(w.y.min=E.top,w.y.max=E.bottom));var k=_.min,l=_.max;return k&&(Ul(v)?f0(S)?w.x.max=k.left:w.x.min=k.right:m0(S)?w.y.max=k.top:w.y.min=k.bottom),l&&(Ul(v)?f0(S)?w.x.min=l.left:w.x.max=l.right:m0(S)?w.y.min=l.top:w.y.max=l.bottom),w[v]}(o,u);m&&z(p,m),co(o,u)||r.snapEvent(o,u,p)})}})}function Ul(e){return e==="x"}function m0(e){return e.indexOf("n")!==-1}function f0(e){return e.indexOf("w")!==-1}function Ar(e,t){Z.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(i){var r=i.context,o=(r.hints||{}).autoResize;if(o){var a=r.shape,s=r.newBounds;Ut(o)?r.newBounds=n.snapComplex(s,o):r.newBounds=n.snapSimple(a,s)}})}function v0(e,t){e.on(["spaceTool.move","spaceTool.end"],2e3,function(n){var i,r=n.context;r.initialized&&(r.axis==="x"?(i=t.snapValue(n.dx),n.x=n.x+i-n.dx,n.dx=i):(i=t.snapValue(n.dy),n.y=n.y+i-n.dy,n.dy=i))})}h0.$inject=["eventBus"],Wi.prototype.snapEvent=function(e,t,n){ct(e,t,this.snapValue(e[t],n))},Wi.prototype.getGridSpacing=function(){return 10},Wi.prototype.snapValue=function(e,t){var n,i,r=0;return t&&t.offset&&(r=t.offset),e=_d(e+=r,10),t&&t.min&&ye(n=t.min)&&(n=_d(n+r,10,"ceil"),e=Math.max(e,n)),t&&t.max&&ye(i=t.max)&&(i=_d(i+r,10,"floor"),e=Math.min(e,i)),e-r},Wi.prototype.isActive=function(){return this.active},Wi.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},Wi.prototype.toggleActive=function(){this.setActive(!this.active)},Wi.$inject=["elementRegistry","eventBus","config.gridSnapping"],Ar.$inject=["eventBus","gridSnapping","modeling"],le(Ar,Z),Ar.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},Ar.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},Ar.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),z(e,o),e},Ar.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),z(e,o),e},v0.$inject=["eventBus","gridSnapping"];const Dw={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Ar],gridSnappingSpaceToolBehavior:["type",v0]}],__init__:["gridSnapping"],gridSnapping:["type",Wi]};function y0(e,t,n){e.on("autoPlace",2e3,function(i){var r=i.source,o=ge(r),a=i.shape,s=_v(r,a,n);return["x","y"].forEach(function(c){var u={};s[c]!==o[c]&&(s[c]>o[c]?u.min=s[c]:u.max=s[c],P(a,"bpmn:TextAnnotation")&&(function(p){return p==="x"}(c)?u.offset=-a.width/2:u.offset=-a.height/2),s[c]=t.snapValue(s[c],u))}),s})}function g0(e,t,n){t.on(["create.start","shape.move.start"],1750,function(i){var r=i.context,o=r.shape,a=e.getRootElement();P(o,"bpmn:Participant")&&P(a,"bpmn:Process")&&a.children.length&&r.createConstraints&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))})}function Hl(e,t,n){Z.call(this,e),this._gridSnapping=t;var i=this;this.postExecuted(["connection.create","connection.layout"],3e3,function(r){var o=r.context,a=o.connection,s=o.hints||{},c=a.waypoints;s.connectionStart||s.connectionEnd||s.createElementsBehavior===!1||function(u){return u.length>3}(c)&&n.updateWaypoints(a,i.snapMiddleSegments(c))})}function Ow(e,t,n){var i=ei(t,n),r={};return function(o){return o==="h"}(i)&&(r.y=e.snapValue(t.y)),function(o){return o==="v"}(i)&&(r.x=e.snapValue(t.x)),("x"in r||"y"in r)&&(t=z({},t,r),n=z({},n,r)),[t,n]}y0.$inject=["eventBus","gridSnapping","elementRegistry"],g0.$inject=["canvas","eventBus","gridSnapping"],Hl.$inject=["eventBus","gridSnapping","modeling"],le(Hl,Z),Hl.prototype.snapMiddleSegments=function(e){var t,n=this._gridSnapping;e=e.slice();for(var i=1;i<e.length-2;i++)t=Ow(n,e[i],e[i+1]),e[i]=t[0],e[i+1]=t[1];return e};const Lw={__depends__:[Dw,{__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",y0],gridSnappingParticipantBehavior:["type",g0],gridSnappingLayoutConnectionBehavior:["type",Hl]}],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",h0]};function Ba(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(i){var r=i.element,o=i.gfx;return P(r,"bpmn:Lane")?n._createParticipantHit(r,o):P(r,"bpmn:Participant")?Ae(r)?n._createParticipantHit(r,o):n._createDefaultHit(r,o):P(r,"bpmn:SubProcess")?Ae(r)?n._createSubProcessHit(r,o):n._createDefaultHit(r,o):void 0})}Ba.$inject=["eventBus","interactionEvents"],Ba.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0},Ba.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=gt(e)?{width:30,height:e.height}:{width:e.width,height:30};return this._interactionEvents.createBoxHit(t,"all",n),!0},Ba.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};const jw={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",Ba]};function Gl(e){e.invoke(Qr,this)}le(Gl,Qr),Gl.$inject=["injector"],Gl.prototype.registerBindings=function(e,t){function n(i,r){t.isRegistered(i)&&e.addListener(r)}Qr.prototype.registerBindings.call(this,e,t),n("selectElements",function(i){var r=i.keyEvent;if(e.isKey(["a","A"],r)&&e.isCmd(r))return t.trigger("selectElements"),!0}),n("find",function(i){var r=i.keyEvent;if(e.isKey(["f","F"],r)&&e.isCmd(r))return t.trigger("find"),!0}),n("spaceTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["s","S"],r)?(t.trigger("spaceTool"),!0):void 0}),n("lassoTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["l","L"],r)?(t.trigger("lassoTool"),!0):void 0}),n("handTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["h","H"],r)?(t.trigger("handTool"),!0):void 0}),n("globalConnectTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["c","C"],r)?(t.trigger("globalConnectTool"),!0):void 0}),n("directEditing",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["e","E"],r)?(t.trigger("directEditing"),!0):void 0}),n("replaceElement",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["r","R"],r)?(t.trigger("replaceElement",r),!0):void 0})};const Vw={__depends__:[Au],__init__:["keyboardBindings"],keyboardBindings:["type",Gl]};var $w={moveSpeed:1,moveSpeedAccelerated:10},b0="left",x0="right",_0="down",Fw={ArrowLeft:b0,Left:b0,ArrowUp:"up",Up:"up",ArrowRight:x0,Right:x0,ArrowDown:_0,Down:_0},zw={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 E0(e,t,n,i,r){var o=this;this._config=z({},$w,e||{}),t.addListener(1500,function(a){var s=a.keyEvent,c=Fw[s.key];if(c&&!t.isCmd(s)){var u=t.isShift(s);return o.moveSelection(c,u),!0}}),this.moveSelection=function(a,s){var c=r.get();if(c.length){var u=this._config[s?"moveSpeedAccelerated":"moveSpeed"],p=zw[a](u);i.allowed("elements.move",{shapes:c})&&n.moveElements(c,p)}}}E0.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];const Uw={__depends__:[Au,Gn],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",E0]};function Da(e,t,n,i){this._dragging=i,this._rules=t;var r=this;e.on("resize.start",function(o){var a,s,c;s=(a=o.context).resizeConstraints,c=a.minBounds,s===void 0&&(c===void 0&&(c=r.computeMinResizeBox(a)),a.resizeConstraints={min:de(c)})}),e.on("resize.move",function(o){var a={x:o.dx,y:o.dy};(function(s,c){var u,p=s.shape,d=s.direction,m=s.resizeConstraints;s.delta=c,u=function(f,v,g){var E=g.x,_=g.y,b={x:f.x,y:f.y,width:f.width,height:f.height};return v.indexOf("n")!==-1?(b.y=f.y+_,b.height=f.height-_):v.indexOf("s")!==-1&&(b.height=f.height+_),v.indexOf("e")!==-1?b.width=f.width+E:v.indexOf("w")!==-1&&(b.x=f.x+E,b.width=f.width-E),b}(p,d,c),s.newBounds=function(f,v){if(!v)return f;var g=de(f);return hs({top:al("top",g,v),right:al("right",g,v),bottom:al("bottom",g,v),left:al("left",g,v)})}(u,m),s.canExecute=r.canResize(s)})(o.context,a)}),e.on("resize.end",function(o){(function(a){var s=a.shape,c=a.canExecute,u=a.newBounds;if(c){if(!function(p,d){return p.x!==d.x||p.y!==d.y||p.width!==d.width||p.height!==d.height}(s,u=xm(u)))return;n.resizeShape(s,u)}})(o.context)})}function w0(e,t){var n=ge(e),i=de(e),r={x:n.x,y:n.y};return t.indexOf("n")!==-1?r.y=i.top:t.indexOf("s")!==-1&&(r.y=i.bottom),t.indexOf("e")!==-1?r.x=i.right:t.indexOf("w")!==-1&&(r.x=i.left),r}function Hw(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}Da.prototype.canResize=function(e){var t=this._rules,n=Pn(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},Da.prototype.activate=function(e,t,n){var i,r,o=this._dragging;if(typeof n=="string"&&(n={direction:n}),!(r=(i=z({shape:t},n)).direction))throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");o.init(e,w0(t,r),"resize",{autoActivate:!0,cursor:Hw(r),data:{shape:t,context:i}})},Da.prototype.computeMinResizeBox=function(e){var t,n,i,r,o,a,s,c=e.shape;return t=e.direction,n=c,i=e.minDimensions||{width:10,height:10},r=cy(c,e.childrenBoxPadding),o=de(n),a={top:/n/.test(t)?o.bottom-i.height:o.top,left:/w/.test(t)?o.right-i.width:o.left,bottom:/s/.test(t)?o.top+i.height:o.bottom,right:/e/.test(t)?o.left+i.width:o.right},s=r?de(r):a,hs({top:ol(a.top,s.top),left:ol(a.left,s.left),bottom:rl(a.bottom,s.bottom),right:rl(a.right,s.right)})},Da.$inject=["eventBus","rules","modeling","dragging"];var S0="djs-resizing",C0="resize-not-ok";function k0(e,t,n){e.on("resize.move",500,function(i){var r,o,a,s;o=(r=i.context).shape,a=r.newBounds,(s=r.frame)||(s=r.frame=n.addFrame(o,t.getActiveLayer()),t.addMarker(o,S0)),a.width>5&&ae(s,{x:a.x,width:a.width}),a.height>5&&ae(s,{y:a.y,height:a.height}),r.canExecute?Pe(s).remove(C0):Pe(s).add(C0)}),e.on("resize.cleanup",function(i){var r,o;o=(r=i.context).shape,r.frame&&dt(r.frame),t.removeMarker(o,S0)})}k0.$inject=["eventBus","canvas","previewSupport"];var Oa="djs-resizer",Gw=["n","w","s","e","nw","ne","se","sw"];function qi(e,t,n,i){this._resize=i,this._canvas=t;var r=this;e.on("selection.changed",function(o){var a=o.newSelection;r.removeResizers(),a.length===1&&$(a,jt(r.addResizer,r))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(r.removeResizers(),r.addResizer(a))})}qi.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(o){Ii(o)&&i.activate(o,e,n)}ve.bind(t,"mousedown",r),ve.bind(t,"touchstart",r)},qi.prototype._createResizer=function(e,t,n,i){var r=this._getResizersParent(),o=function(u){var p={x:0,y:0};return u.indexOf("e")!==-1?p.x=6:u.indexOf("w")!==-1&&(p.x=-6),u.indexOf("s")!==-1?p.y=6:u.indexOf("n")!==-1&&(p.y=-6),p}(i),a=ue("g");Pe(a).add(Oa),Pe(a).add(Oa+"-"+e.id),Pe(a).add(Oa+"-"+i),xe(r,a);var s=ue("rect");ae(s,{x:-4+o.x,y:-4+o.y,width:8,height:8}),Pe(s).add(Oa+"-visual"),xe(a,s);var c=ue("rect");return ae(c,{x:-10+o.x,y:-10+o.y,width:20,height:20}),Pe(c).add(Oa+"-hit"),xe(a,c),vs(a,t,n),a},qi.prototype.createResizer=function(e,t){var n=w0(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},qi.prototype.addResizer=function(e){var t=this;!Fe(e)&&this._resize.canResize({shape:e})&&$(Gw,function(n){t.createResizer(e,n)})},qi.prototype.removeResizers=function(){rs(this._getResizersParent())},qi.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},qi.$inject=["eventBus","canvas","selection","resize"];const A0={__depends__:[qn,ci,uo],__init__:["resize","resizePreview","resizeHandles"],resize:["type",Da],resizePreview:["type",k0],resizeHandles:["type",qi]};function La(e,t,n,i,r,o,a){function s(c,u){(u||Se(c,["bpmn:Task","bpmn:TextAnnotation","bpmn:Participant"])||Ed(c))&&i.activate(c)}this._bpmnFactory=t,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),e.on("element.dblclick",function(c){s(c.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(c){i.isActive(c.element)&&i.cancel()}),e.on(["commandStack.changed"],function(c){i.isActive()&&i.cancel()}),e.on("directEditing.activate",function(c){o.removeResizers()}),e.on("create.end",500,function(c){var u=c.context,p=u.shape,d=c.context.canExecute;c.isTouch||d&&(u.hints&&u.hints.createElementsBehavior===!1||s(p))}),e.on("autoPlace.end",500,function(c){s(c.shape)})}function Ed(e){return P(e,"bpmn:SubProcess")&&!Ae(e)}La.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],La.prototype.activate=function(e){var t=tn(e);if(t!==void 0){var n={text:t};z(n,this.getEditingBBox(e));var i={},r=n.style||{};return z(r,{backgroundColor:null,border:null}),(Se(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||Ed(e))&&z(i,{centerVertically:!0}),hr(e)&&(z(i,{autoResize:!0}),z(r,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),P(e,"bpmn:TextAnnotation")&&(z(i,{resizable:!0,autoResize:!0}),z(r,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),z(n,{options:i,style:r}),n}},La.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r=i.x+i.width/2,o=i.y+i.height/2,a={x:i.x,y:i.y},s=t.zoom(),c=this._textRenderer.getDefaultStyle(),u=this._textRenderer.getExternalStyle(),p=u.fontSize*s,d=u.lineHeight,m=c.fontSize*s,f=c.lineHeight,v={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};if(P(e,"bpmn:Lane")||function(h){return P(h,"bpmn:Participant")&&Ae(h)}(e)){var g=gt(e);z(a,g?{width:i.height,height:30*s,x:i.x-i.height/2+15*s,y:o-30*s/2}:{width:i.width,height:30*s}),z(v,{fontSize:m+"px",lineHeight:f,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px",transform:g?"rotate(-90deg)":null})}if(function(h){return P(h,"bpmn:Participant")&&!Ae(h)}(e)){var E=gt(e);z(a,E?{width:i.width,height:i.height}:{width:i.height,height:i.width,x:r-i.height/2,y:o-i.width/2}),z(v,{fontSize:m+"px",lineHeight:f,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px",transform:E?null:"rotate(-90deg)"})}(Se(e,["bpmn:Task","bpmn:CallActivity"])||Ed(e))&&(z(a,{width:i.width,height:i.height}),z(v,{fontSize:m+"px",lineHeight:f,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px"})),function(h){return P(h,"bpmn:SubProcess")&&Ae(h)}(e)&&(z(a,{width:i.width,x:i.x}),z(v,{fontSize:m+"px",lineHeight:f,paddingTop:7*s+"px",paddingBottom:7*s+"px",paddingLeft:5*s+"px",paddingRight:5*s+"px"}));var _=90*s,b=7*s,w=4*s;if(n.labelTarget&&(z(a,{width:_,height:i.height+b+w,x:r-_/2,y:i.y-b}),z(v,{fontSize:p+"px",lineHeight:d,paddingTop:b+"px",paddingBottom:w+"px"})),hr(n)&&!ws(n)&&!Re(n)){var S=gu(e),k=t.getAbsoluteBBox({x:S.x,y:S.y,width:0,height:0}),l=p+b+w;z(a,{width:_,height:l,x:k.x-_/2,y:k.y-l/2}),z(v,{fontSize:p+"px",lineHeight:d,paddingTop:b+"px",paddingBottom:w+"px"})}return P(e,"bpmn:TextAnnotation")&&(z(a,{width:i.width,height:i.height,minWidth:30*s,minHeight:10*s}),z(v,{textAlign:"left",paddingTop:5*s+"px",paddingBottom:7*s+"px",paddingLeft:7*s+"px",paddingRight:5*s+"px",fontSize:m+"px",lineHeight:f})),{bounds:a,style:v}},La.prototype.update=function(e,t,n,i){var r,o,a;P(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 T0="djs-element-hidden",P0="djs-label-hidden";function R0(e,t,n){var i,r,o,a=this,s=t.getDefaultLayer();e.on("directEditing.activate",function(c){var u=c.active;if(P(i=u.element.label||u.element,"bpmn:TextAnnotation")){r=t.getAbsoluteBBox(i),o=ue("g");var p=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:i.width,containerHeight:i.height,position:{mx:0,my:0}}),d=a.path=ue("path");ae(d,{d:p,strokeWidth:2,stroke:Ww(i)}),xe(o,d),xe(s,o),Et(o,i.x,i.y)}P(i,"bpmn:TextAnnotation")||i.labelTarget?t.addMarker(i,T0):(P(i,"bpmn:Task")||P(i,"bpmn:CallActivity")||P(i,"bpmn:SubProcess")||P(i,"bpmn:Participant")||P(i,"bpmn:Lane"))&&t.addMarker(i,P0)}),e.on("directEditing.resize",function(c){if(P(i,"bpmn:TextAnnotation")){var u=c.height,p=c.dy,d=Math.max(i.height/r.height*(u+p),0),m=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:i.width,containerHeight:d,position:{mx:0,my:0}});ae(a.path,{d:m})}}),e.on(["directEditing.complete","directEditing.cancel"],function(c){var u=c.active;u&&(t.removeMarker(u.element.label||u.element,T0),t.removeMarker(i,P0)),i=void 0,r=void 0,o&&(dt(o),o=void 0)})}function Ww(e,t){return Me(e).get("stroke")||t||"black"}R0.$inject=["eventBus","canvas","pathMap"];const qw={__depends__:[xu,A0,s0],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",La],labelEditingPreview:["type",R0]};var Kw=new Xo("tt");function wd(e,t){e.style.display=t===!1?"none":""}var M0="djs-tooltip",Sd="."+M0;function $t(e,t){var n,i;this._eventBus=e,this._canvas=t,this._ids=Kw,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=(n=t.getContainer(),At(i=He('<div class="djs-tooltip-container" />'),{position:"absolute",width:"0",height:"0"}),n.insertBefore(i,n.firstChild),i);var r=this;un(this._tooltipRoot,Sd,"mousedown",function(o){o.stopPropagation()}),un(this._tooltipRoot,Sd,"mouseover",function(o){r.trigger("mouseover",o)}),un(this._tooltipRoot,Sd,"mouseout",function(o){r.trigger("mouseout",o)}),this._init()}$t.$inject=["eventBus","canvas"],$t.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=z({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},$t.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get(It(n,"data-tooltip-id"));i&&(e==="mouseover"&&i.timeout&&this.clearTimeout(i),e==="mouseout"&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},$t.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]},$t.prototype.clearTimeout=function(e){if(e=this.get(e)){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},$t.prototype.setTimeout=function(e){if(e=this.get(e)){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}},$t.prototype.remove=function(e){var t=this.get(e);t&&(Fn(t.html),Fn(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},$t.prototype.show=function(){wd(this._tooltipRoot)},$t.prototype.hide=function(){wd(this._tooltipRoot,!1)},$t.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},$t.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)),Ut(i)&&(i=He(i)),At(t=He('<div data-tooltip-id="'+n+'" class="'+M0+'">'),{position:"absolute"}),t.appendChild(i),e.type&&Ke(t).add("djs-tooltip-"+e.type),e.className&&Ke(t).add(e.className),e.htmlContainer=t,r.appendChild(t),this._tooltips[n]=e,this._updateTooltip(e)},$t.prototype._updateTooltip=function(e){var t=e.position;(function(n,i,r){At(n,{left:i+"px",top:r+"px"})})(e.htmlContainer,t.x,t.y)},$t.prototype._updateTooltipVisibilty=function(e){$(this._tooltips,function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(r=!1),wd(i,r))})},$t.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()})};const Xw={__init__:["tooltips"],tooltips:["type",$t]};function N0(e,t,n){e.on(["shape.move.rejected","create.rejected"],function(i){var r,o,a=i.context,s=a.shape;P(a.target,"bpmn:Collaboration")&&P(s,"bpmn:FlowNode")&&(r=i,o=n("flow elements must be children of pools/participants"),t.add({position:{x:r.x+5,y:r.y+5},type:"error",timeout:2e3,html:"<div>"+o+"</div>"}))})}N0.$inject=["eventBus","tooltips","translate"];const Yw={__depends__:[Xw],__init__:["modelingFeedback"],modelingFeedback:["type",N0]};var Wl=Math.round;function I0(e,t,n,i,r){function o(s,c,u,p){return r.allowed("elements.move",{shapes:s,delta:c,position:u,target:p})}function a(s,c,u,p){if(vt(u)&&(p=u,u=!1),!c.waypoints&&c.parent&&!Pe(s.target).has("djs-hit-no-move")){var d=function(m){return{x:m.x+Wl(m.width/2),y:m.y+Wl(m.height/2)}}(c);return t.init(s,d,"shape.move",{cursor:"grabbing",autoActivate:u,data:{shape:c,context:p||{}}}),!0}}e.on("shape.move.start",1500,function(s){var c=s.context,u=s.shape,p=i.get().slice();p.indexOf(u)===-1&&(p=[u]),p=function(d){var m=zr(d,"id");return Ce(d,function(f){for(;f=f.parent;)if(m[f.id])return!1;return!0})}(p),z(c,{shapes:p,validatedShapes:p,shape:u})}),e.on("shape.move.start",1250,function(s){var c=s.context,u=c.validatedShapes;if(!(c.canExecute=o(u)))return!1}),e.on("shape.move.move",500,function(s){var c,u=s.context,p=u.validatedShapes,d=s.hover,m={x:s.dx,y:s.dy};c=o(p,m,{x:s.x,y:s.y},d),u.delta=m,u.canExecute=c,u.target=c!==null?d:null}),e.on("shape.move.end",function(s){var c=s.context,u=c.delta,p=c.canExecute,d=p==="attach",m=c.shapes;if(p===!1)return!1;u.x=Wl(u.x),u.y=Wl(u.y),u.x===0&&u.y===0||n.moveElements(m,u,c.target,{primaryShape:c.shape,attach:d})}),e.on("element.mousedown",function(s){if(Ii(s)){var c=Jr(s);if(!c)throw new Error("must supply DOM mousedown event");return a(c,s.element)}}),this.start=a}I0.$inject=["eventBus","dragging","modeling","selection","rules"];var Cd="djs-dragging",B0="drop-ok",D0="drop-not-ok",O0="new-parent",L0="attach-ok";function j0(e,t,n,i){function r(a){var s=Oo(a,!0),c=s.flatMap(p=>(p.incoming||[]).concat(p.outgoing||[])),u=s.concat(c);return[...new Set(u)]}function o(a,s){[L0,B0,D0,O0].forEach(function(c){c===s?t.addMarker(a,c):t.removeMarker(a,c)})}e.on("shape.move.start",499,function(a){var s,c,u=a.context,p=u.shapes,d=u.allDraggedElements,m=Ce(c=r(p),function(v){return!Fe(v)||Be(c,Tn({id:v.source.id}))&&Be(c,Tn({id:v.target.id}))});if(!u.dragGroup){var f=ue("g");ae(f,n.cls("djs-drag-group",["no-events"])),xe(t.getActiveLayer(),f),u.dragGroup=f}m.forEach(function(v){i.addDragger(v,u.dragGroup)}),$(d=d?$c([d,r(p)]):r(p),function(v){t.addMarker(v,Cd)}),u.allDraggedElements=d,u.differentParents=(s=zr(p,function(v){return v.parent&&v.parent.id}),Za(s).length!==1)}),e.on("shape.move.move",499,function(a){var s=a.context,c=s.dragGroup,u=s.target,p=s.shape.parent,d=s.canExecute;u&&(d==="attach"?o(u,L0):s.canExecute&&p&&u.id!==p.id?o(u,O0):o(u,s.canExecute?B0:D0)),Et(c,a.dx,a.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(a){var s=a.context.target;s&&o(s,null)}),e.on("shape.move.cleanup",function(a){var s=a.context,c=s.allDraggedElements,u=s.dragGroup;$(c,function(p){t.removeMarker(p,Cd)}),u&&dt(u)}),this.makeDraggable=function(a,s,c){i.addDragger(s,a.dragGroup),c&&t.addMarker(s,Cd),a.allDraggedElements?a.allDraggedElements.push(s):a.allDraggedElements=[s]}}j0.$inject=["eventBus","canvas","styles","previewSupport"];const Jw={__depends__:[Bs,Gn,wu,qn,ci,uo],__init__:["move","movePreview"],move:["type",I0],movePreview:["type",j0]};var V0=".djs-palette-toggle",$0=".entry",Zw=V0+", "+$0,kd="djs-palette-",Ad="open",F0="two-column";function ut(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(i){var r=i.tool;n.updateToolHighlight(r)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}function Qw(e,t){var n=t.getPaletteEntries();return rt(n)?n(e):($(n,function(i,r){e[r]=i}),e)}ut.$inject=["eventBus","canvas"],ut.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()},ut.prototype.getEntries=function(){return this._getProviders().reduce(Qw,{})},ut.prototype._rebuild=function(){this._diagramInitialized&&this._getProviders().length&&(this._container||this._init(),this._update())},ut.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),i=this._container=He(ut.HTML_MARKUP);n.appendChild(i),Ke(n).add(kd+"shown"),un(i,Zw,"click",function(r){if(is(r.delegateTarget,V0))return e.toggle();e.trigger("click",r)}),ve.bind(i,"mousedown",function(r){r.stopPropagation()}),un(i,$0,"dragstart",function(r){e.trigger("dragstart",r)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:i})},ut.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},ut.prototype._toggleState=function(e){e=e||{};var t,n=this._getParentContainer(),i=this._container,r=this._eventBus,o=Ke(i),a=Ke(n);t="twoColumn"in e?e.twoColumn:this._needsCollapse(n.clientHeight,this._entries||{}),o.toggle(F0,t),a.toggle(kd+F0,t),"open"in e&&(o.toggle(Ad,e.open),a.toggle(kd+Ad,e.open)),r.fire("palette.changed",{twoColumn:t,open:this.isOpen()})},ut.prototype._update=function(){var e=Ve(".djs-palette-entries",this._container),t=this._entries=this.getEntries();es(e),$(t,function(n,i){var r=n.group||"default",o=Ve("[data-group="+Yo(r)+"]",e);o||(It(o=He('<div class="group"></div>'),"data-group",r),e.appendChild(o));var a=n.html||(n.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),s=He(a);if(o.appendChild(s),!n.separator&&(It(s,"data-action",i),n.title&&It(s,"title",n.title),n.className&&function(u,p){var d=Ke(u);(Ee(p)?p:p.split(/\s+/g)).forEach(function(m){d.add(m)})}(s,n.className),n.imageUrl)){var c=He("<img>");It(c,"src",n.imageUrl),s.appendChild(c)}}),this.open()},ut.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=It(o,"data-action"),r=t.originalEvent||t,this.triggerEntry(i,e,r,n)):t.preventDefault()},ut.prototype.triggerEntry=function(e,t,n,i){var r,o;if((r=this._entries[e])&&(o=r.action,this._eventBus.fire("palette.trigger",{entry:r,event:n})!==!1)){if(rt(o)){if(t==="click")return o(n,i)}else if(o[t])return o[t](n,i);n.preventDefault()}},ut.prototype._layoutChanged=function(){this._toggleState({})},ut.prototype._needsCollapse=function(e,t){return e<46*Object.keys(t).length+50},ut.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},ut.prototype.open=function(){this._toggleState({open:!0})},ut.prototype.toggle=function(){this.isOpen()?this.close():this.open()},ut.prototype.isActiveTool=function(e){return e&&this._activeTool===e},ut.prototype.updateToolHighlight=function(e){var t;this._toolsContainer||(t=Ve(".djs-palette-entries",this._container),this._toolsContainer=Ve("[data-group=tools]",t)),$(this._toolsContainer.children,function(n){var i=n.getAttribute("data-action");if(i){var r=Ke(n);i=i.replace("-tool",""),r.contains("entry")&&i===e?r.add("highlighted-entry"):r.remove("highlighted-entry")}})},ut.prototype.isOpen=function(){return Ke(this._container).has(Ad)},ut.prototype._getParentContainer=function(){return this._canvas.getContainer()},ut.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';const eS={__init__:["palette"],palette:["type",ut]};var z0="crosshair";function Tr(e,t,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var s=this;o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(c){var u=c.originalEvent.target;(c.hover||u instanceof SVGElement)&&e.once("lasso.selection.ended",function(){s.activateLasso(c.originalEvent,!0)})}),e.on("lasso.end",0,function(c){var u=c.context,p=Td(c),d=i.filter(function(f){return f}),m=Ns(c);s.select(d,p,m?u.selection:[])}),e.on("lasso.start",function(c){var u=c.context;u.bbox=Td(c),function(p){var d,m=t.getActiveLayer();ae(d=p.frame=ue("rect"),{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),xe(m,d)}(u),u.selection=r.get()}),e.on("lasso.move",function(c){var u=c.context;u.bbox=Td(c),function(p){var d=p.frame,m=p.bbox;ae(d,{x:m.x,y:m.y,width:m.width,height:m.height})}(u)}),e.on("lasso.cleanup",function(c){(function(u){u.frame&&dt(u.frame)})(c.context)}),e.on("element.mousedown",1500,function(c){if(Ns(c))return s.activateLasso(c.originalEvent),!0})}function Td(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}}Tr.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],Tr.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:z0,data:{context:{}}})},Tr.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:z0,data:{context:{}},keepSelection:!0})},Tr.prototype.select=function(e,t,n=[]){var i=function(r,o){var a={};return $(r,function(s){var c=s;c.waypoints&&(c=yt(c)),!ye(o.y)&&c.x>o.x&&(a[s.id]=s),!ye(o.x)&&c.y>o.y&&(a[s.id]=s),c.x>o.x&&c.y>o.y&&(ye(o.width)&&ye(o.height)&&c.width+c.x<o.width+o.x&&c.height+c.y<o.height+o.y?a[s.id]=s:ye(o.width)&&ye(o.height)||(a[s.id]=s))}),a}(e,t);this._selection.select([...n,...Fc(i)])},Tr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Tr.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};const tS={__depends__:[wl,ma],__init__:["lassoTool"],lassoTool:["type",Tr]};var Pd=1500,U0="grab";function xo(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",Pd,function(c){if(Jo(c))return a.activateMove(c.originalEvent,!0),!1}),s&&s.addListener(Pd,function(c){if(H0(c.keyEvent)&&!a.isActive()){var u=a._mouse.getLastMoveEvent();a.activateMove(u,!!u)}},"keyboard.keydown"),s&&s.addListener(Pd,function(c){H0(c.keyEvent)&&a.isActive()&&a.toggle()},"keyboard.keyup"),e.on("hand.end",function(c){var u=c.originalEvent.target;if(!(c.hover||u instanceof SVGElement))return!1;e.once("hand.ended",function(){a.activateMove(c.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(c){var u=t.viewbox().scale;t.scroll({dx:c.dx*u,dy:c.dy*u})}),e.on("hand.move.end",function(c){var u=c.context.reactivate;return!Jo(c)&&u&&e.once("hand.move.ended",function(p){a.activateHand(p.originalEvent,!0,!0)}),!1})}function H0(e){return bt("Space",e)}xo.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],xo.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:U0,data:{context:n||{}}})},xo.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:U0,data:{context:{reactivate:n}}})},xo.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},xo.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^(hand|hand\.move)$/.test(e.prefix)};const nS={__depends__:[wl,ma],__init__:["handTool"],handTool:["type",xo]};var G0="connect-ok",W0="connect-not-ok";function _o(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(c){var u=c.context,p=c.hover,d=u.canStartConnect=s.canStartConnect(p);d!==null&&(u.startTarget=p,i.addMarker(p,d?G0:W0))}),e.on(["global-connect.out","global-connect.cleanup"],function(c){var u=c.context.startTarget,p=c.context.canStartConnect;u&&i.removeMarker(u,p?G0:W0)}),e.on(["global-connect.ended"],function(c){var u=c.context.startTarget,p={x:c.x,y:c.y};if(s.canStartConnect(u))return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,u,p)}),!1})}_o.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],_o.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},_o.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},_o.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},_o.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};const iS={__depends__:[ip,qn,ci,wl,ma],globalConnect:["type",_o]};function ql(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)}ql.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],ql.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(d,m,f,v,g){function E(_){var b=n.createShape(z({type:d},g));t.start(_,b)}return{group:m,className:f,title:v,action:{dragstart:E,click:E}}}function u(d){var m=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),f=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:m});t.start(d,[m,f],{hints:{autoSelect:[m]}})}function p(d){t.start(d,n.createParticipantShape())}return z(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:s("Activate hand tool"),action:{click:function(d){o.activateHand(d)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:s("Activate lasso tool"),action:{click:function(d){r.activateSelection(d)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:s("Activate create/remove space tool"),action:{click:function(d){i.activateSelection(d)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:s("Activate global connect tool"),action:{click:function(d){a.start(d)}}},"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-end-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:u,click:u}},"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};const rS={__depends__:[eS,_l,Cg,tS,nS,iS,Cs],__init__:["paletteProvider"],paletteProvider:["type",ql]};function Rd(e,t,n,i,r){Z.call(this,e),e.on("shape.move.move",250,function(o){var a=o.context,s=a.canExecute;a.visualReplacements||(a.visualReplacements={}),s&&s.replacements?function(c){$(c.canExecute.replacements,function(u){var p=u.oldElementId,d={type:u.newElementType};if(!c.visualReplacements[p]){var m=t.get(p);z(d,{x:m.x,y:m.y});var f=n.createShape(d);i.addShape(f,m.parent);var v=Ve('[data-element-id="'+Yo(m.id)+'"]',c.dragGroup);v&&ae(v,{display:"none"});var g=r.addDragger(f,c.dragGroup);c.visualReplacements[p]=g,i.removeShape(f)}})}(a):function(c){var u=c.visualReplacements;$(u,function(p,d){var m=Ve('[data-element-id="'+Yo(d)+'"]',c.dragGroup);m&&ae(m,{display:"inline"}),p.remove(),u[d]&&delete u[d]})}(a)})}Rd.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],le(Rd,Z);const oS={__depends__:[uo],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",Rd]};var q0=["x","y"],aS=Math.abs;function K0(e){e.on(["connect.hover","connect.move","connect.end"],1250,function(t){var n,i=t.context,r=i.canExecute,o=i.start,a=i.hover,s=i.source,c=i.target;t.originalEvent&&nn(t.originalEvent)||(i.initialConnectionStart||(i.initialConnectionStart=i.connectionStart),r&&a&&function(u,p,d){q0.forEach(function(m){var f=J0(m,p);u[m]<p[m]+d?ct(u,m,p[m]+d):u[m]>p[m]+f-d&&ct(u,m,p[m]+f-d)})}(t,a,function(u){return P(u,"bpmn:Task")?10:20}(a)),a&&(n=r,Gt(["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"],function(u){return Y0(n,u)}))?(i.connectionStart=fn(o),Se(a,["bpmn:Event","bpmn:Gateway"])&&X0(t,fn(a)),Se(a,["bpmn:Task","bpmn:SubProcess"])&&function(u,p){var d=fn(p);q0.forEach(function(m){(function(f,v,g){return f[g]>v[g]+20&&f[g]<v[g]+J0(g,v)-20})(u,p,m)&&ct(u,m,d[m])})}(t,a),P(s,"bpmn:BoundaryEvent")&&c===s.host&&function(u){var p=u.context,d=p.source,m=p.target;if(!function(E){var _=E.hover,b=E.source;return _&&b&&_===b}(p)){var f=fn(d),v=Tt(f,m,-10),g=[];/top|bottom/.test(v)&&g.push("x"),/left|right/.test(v)&&g.push("y"),g.forEach(function(E){var _,b=u[E];aS(b-f[E])<40&&(_=b>f[E]?f[E]+40:f[E]-40,ct(u,E,_))})}}(t)):Y0(r,"bpmn:MessageFlow")?(P(o,"bpmn:Event")&&(i.connectionStart=fn(o)),P(a,"bpmn:Event")&&X0(t,fn(a))):i.connectionStart=i.initialConnectionStart)})}function X0(e,t){ct(e,"x",t.x),ct(e,"y",t.y)}function Y0(e,t){return e&&e.type===t}function J0(e,t){return e==="x"?t.width:t.height}function Ki(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function Kl(){this._snapValues={}}function Xn(e,t,n){var i=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(r){i.initSnap(r)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],1250,function(r){var o=r.context,a=o.shape,s=o.snapContext,c=o.target;if((!r.originalEvent||!nn(r.originalEvent))&&!co(r)&&c){var u=s.pointsForTarget(c);u.initialized||((u=i.addSnapTargetPoints(u,a,c)).initialized=!0),n.snap(r,u)}}),t.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}function Eo(e,t){t.invoke(Xn,this),e.on(["create.move","create.end"],1500,sS),e.on(["create.move","create.end","shape.move.move","shape.move.end"],1500,function(n){var i=n.context,r=i.canExecute,o=i.target;r&&(r==="attach"||r.attach)&&!co(n)&&function(a,s){var c,u=de(s),p=Vy(a,s),d=a.context.shape;c=d.parent?{x:0,y:0}:ge(d),/top/.test(p)?ct(a,"y",u.top-c.y):/bottom/.test(p)&&ct(a,"y",u.bottom-c.y),/left/.test(p)?ct(a,"x",u.left-c.x):/right/.test(p)&&ct(a,"x",u.right-c.x)}(n,o)})}function sS(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)&&ct(e,"x",e.x),(n&&n>=e.y||r&&r<=e.y)&&ct(e,"y",e.y)}}function Z0(e,t){return e.indexOf(t)!==-1}function Q0(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}function ja(e,t){var n=this;e.on(["resize.start"],function(i){n.initSnap(i)}),e.on(["resize.move","resize.end"],1250,function(i){var r=i.context,o=r.shape,a=o.parent,s=r.direction,c=r.snapContext;if(!(i.originalEvent&&nn(i.originalEvent)||co(i))){var u=c.pointsForTarget(a);u.initialized||((u=n.addSnapTargetPoints(u,o,a,s)).initialized=!0),function(p){return p==="n"||p==="s"}(s)&&ct(i,"x",i.x),function(p){return p==="e"||p==="w"}(s)&&ct(i,"y",i.y),t.snap(i,u)}}),e.on(["resize.cleanup"],function(){t.hide()})}function eb(e,t){var n=ge(e),i=de(e),r={x:n.x,y:n.y};return t.indexOf("n")!==-1?r.y=i.top:t.indexOf("s")!==-1&&(r.y=i.bottom),t.indexOf("e")!==-1?r.x=i.right:t.indexOf("w")!==-1&&(r.x=i.left),r}function Xi(e){this._canvas=e,this._asyncHide=$h(jt(this.hide,this),1e3)}K0.$inject=["eventBus"],Ki.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},Ki.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,this._snapLocations.indexOf(e)===-1&&this._snapLocations.push(e)},Ki.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},Ki.prototype.getSnapLocations=function(){return this._snapLocations},Ki.prototype.setSnapLocations=function(e){this._snapLocations=e},Ki.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new Kl).initDefaults(this._defaultSnaps),n},Kl.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),n.x.indexOf(t.x)===-1&&n.x.push(t.x),n.y.indexOf(t.y)===-1&&n.y.push(t.y)},Kl.prototype.snap=function(e,t,n,i){var r=this._snapValues[t];return r&&function(o,a,s){var c,u;for(s=s===void 0?10:s,c=0;c<a.length;c++)if(u=a[c],c1(u-o)<=s)return u}(e[n],r[n],i)},Kl.prototype.initDefaults=function(e){var t=this;$(e||{},function(n,i){$(n,function(r){t.add(i,r)})})},Xn.$inject=["elementRegistry","eventBus","snapping"],Xn.prototype.initSnap=function(e){var t,n=this._elementRegistry,i=e.context,r=i.shape,o=i.snapContext;o||(o=i.snapContext=new Ki);var a=(t=n.get(r.id)?fn(r,e):{x:e.x+fn(r).x,y:e.y+fn(r).y}).x-r.width/2,s=t.y-r.height/2,c=t.x+r.width/2,u=t.y+r.height/2;return o.setSnapOrigin("mid",{x:t.x-e.x,y:t.y-e.y}),Re(r)||(o.setSnapOrigin("top-left",{x:a-e.x,y:s-e.y}),o.setSnapOrigin("bottom-right",{x:c-e.x,y:u-e.y})),o},Xn.prototype.addSnapTargetPoints=function(e,t,n){return $(this.getSnapTargets(t,n),function(i){if(Re(i))Re(t)&&e.add("mid",fn(i));else if(Fe(i)){if(i.waypoints.length<3)return;$(i.waypoints.slice(1,-1),function(r){e.add("mid",r)})}else e.add("mid",fn(i))}),ye(t.x)&&ye(t.y)&&this._elementRegistry.get(t.id)&&e.add("mid",fn(t)),e},Xn.prototype.getSnapTargets=function(e,t){return Yv(t).filter(function(n){return!n.hidden})},le(Eo,Xn),Eo.$inject=["eventBus","injector"],Eo.prototype.initSnap=function(e){var t=Xn.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return $(n.outgoing,function(r){var o=r.waypoints[0];o=o.original||o,t.setSnapOrigin(r.id+"-docking",Q0(o,i,e))}),$(n.incoming,function(r){var o=r.waypoints[r.waypoints.length-1];o=o.original||o,t.setSnapOrigin(r.id+"-docking",Q0(o,i,e))}),P(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},Eo.prototype.addSnapTargetPoints=function(e,t,n){Xn.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n);$(i,function(o){var a;(P(a=o,"bpmn:SubProcess")&&Ae(a)||P(a,"bpmn:Participant")||[t,o].every(function(s){return P(s,"bpmn:TextAnnotation")}))&&(e.add("top-left",Kv(o)),e.add("bottom-right",Xv(o)))});var r=this._elementRegistry;return $(t.incoming,function(o){if(r.get(t.id)){Z0(i,o.source)||e.add("mid",ge(o.source));var a=o.waypoints[0];e.add(o.id+"-docking",a.original||a)}}),$(t.outgoing,function(o){if(r.get(t.id)){Z0(i,o.target)||e.add("mid",ge(o.target));var a=o.waypoints[o.waypoints.length-1];e.add(o.id+"-docking",a.original||a)}}),P(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},Eo.prototype.getSnapTargets=function(e,t){return Xn.prototype.getSnapTargets.call(this,e,t).filter(function(n){return!P(n,"bpmn:Lane")})},ja.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new Ki);var o=eb(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},ja.prototype.addSnapTargetPoints=function(e,t,n,i){return $(this.getSnapTargets(t,n),function(r){e.add("corner",Xv(r)),e.add("corner",Kv(r))}),e.add("corner",eb(t,i)),e},ja.$inject=["eventBus","snapping"],ja.prototype.getSnapTargets=function(e,t){return Yv(t).filter(function(n){return i=e,!(n.host===i||Fe(n)||function(r){return!!r.hidden}(n)||Re(n));var i})},Xi.$inject=["canvas"],Xi.prototype.snap=function(e,t){var n=e.context.snapContext,i=n.getSnapLocations(),r={x:co(e,"x"),y:co(e,"y")};$(i,function(o){var a=n.getSnapOrigin(o),s={x:e.x+a.x,y:e.y+a.y};if($(["x","y"],function(c){var u;r[c]||(u=t.snap(s,o,c,7))!==void 0&&(r[c]={value:u,originValue:u-a[c]})}),r.x&&r.y)return!1}),this.showSnapLine("vertical",r.x&&r.x.value),this.showSnapLine("horizontal",r.y&&r.y.value),$(["x","y"],function(o){var a=r[o];vt(a)&&ct(e,o,a.originValue)})},Xi.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=ue("path");return ae(n,{d:"M0,0 L0,0"}),Pe(n).add("djs-snap-line"),xe(t,n),{update:function(i){ye(i)?ae(n,e==="horizontal"?{d:"M-100000,"+i+" L+100000,"+i,display:""}:{d:"M "+i+",-100000 L "+i+", +100000",display:""}):ae(n,{display:"none"})}}},Xi.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},Xi.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},Xi.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},Xi.prototype.hide=function(){$(this._snapLines,function(e){e.update()})};const lS={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",Xn],resizeSnapping:["type",ja],snapping:["type",Xi]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",K0],createMoveSnapping:["type",Eo]};function _e(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=Ve(_e.INPUT_SELECTOR,this._container),this._resultsContainer=Ve(_e.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 tb(e,t,n){var i=function(o){var a="";return o.forEach(function(s){s.matched?a+='<b class="'+_e.RESULT_HIGHLIGHT_CLASS+'">'+Eu(s.matched)+"</b>":a+=Eu(s.normal)}),a!==""?a:null}(t),r=He(n);r.innerHTML=i,e.appendChild(r)}_e.$inject=["canvas","eventBus","selection","translate"],_e.prototype._bindEvents=function(){var e=this;function t(n,i,r,o){e._eventMaps.push({el:n,type:r,listener:un(n,i,r,o)})}t(document,"html","click",function(n){e.close(!1)}),t(this._container,_e.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,_e.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,_e.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,_e.INPUT_SELECTOR,"keydown",function(n){bt("ArrowUp",n)&&n.preventDefault(),bt("ArrowDown",n)&&n.preventDefault()}),t(this._container,_e.INPUT_SELECTOR,"keyup",function(n){if(bt("Escape",n))return e.close();if(bt("Enter",n)){var i=e._getCurrentResult();return i?e._select(i):e.close(!1)}return bt("ArrowUp",n)?e._scrollToDirection(!0):bt("ArrowDown",n)?e._scrollToDirection():void(bt(["ArrowLeft","ArrowRight"],n)||e._search(n.delegateTarget.value))})},_e.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){Hh(e.el,e.type,e.listener)})},_e.prototype._search=function(e){var t=this;if(this._clearResults(),e&&e!==""){var n=this._searchProvider.find(e);if(!(n=n.filter(function(r){return!t._canvas.getRootElements().includes(r.element)})).length)return this._clearMarkers(),void this._selection.select(null);n.forEach(function(r){var o=r.element.id,a=t._createResultNode(r,o);t._results[o]={element:r.element,node:a}});var i=Ve(_e.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}},_e.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},_e.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)}},_e.prototype._clearResults=function(){es(this._resultsContainer),this._results={},this._eventBus.fire("searchPad.cleared")},_e.prototype._clearMarkers=function(){for(var e in this._results)this._canvas.removeMarker(this._results[e].element,"djs-search-preselected")},_e.prototype._getCurrentResult=function(){return Ve(_e.RESULT_SELECTED_SELECTOR,this._resultsContainer)},_e.prototype._createResultNode=function(e,t){var n=He(_e.RESULT_HTML);return e.primaryTokens.length>0&&tb(n,e.primaryTokens,_e.RESULT_PRIMARY_HTML),tb(n,e.secondaryTokens,_e.RESULT_SECONDARY_HTML),It(n,_e.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},_e.prototype.registerProvider=function(e){this._searchProvider=e},_e.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._cachedRootElement=this._canvas.getRootElement(),this._cachedSelection=this._selection.get(),this._cachedViewbox=this._canvas.viewbox(),this._bindEvents(),this._open=!0,Ke(this._canvas.getContainer()).add("djs-search-open"),Ke(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},_e.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,Ke(this._canvas.getContainer()).remove("djs-search-open"),Ke(this._container).remove("open"),this._clearMarkers(),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"))},_e.prototype.toggle=function(){this.isOpen()?this.close():this.open()},_e.prototype.isOpen=function(){return this._open},_e.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){this._clearMarkers(),t&&Ke(t).remove(_e.RESULT_SELECTED_CLASS);var n=It(e,_e.RESULT_ID_ATTRIBUTE),i=this._results[n].element;Ke(e).add(_e.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(i,{top:300}),this._selection.select(i),this._canvas.addMarker(i,"djs-search-preselected"),this._eventBus.fire("searchPad.preselected",i)}},_e.prototype._select=function(e){var t=It(e,_e.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)},_e.prototype._getBoxHtml=function(){const e=He(_e.BOX_HTML),t=Ve(_e.INPUT_SELECTOR,e);return t&&t.setAttribute("aria-label",this._translate("Search in diagram")),e},_e.CONTAINER_SELECTOR=".djs-search-container",_e.INPUT_SELECTOR=".djs-search-input input",_e.RESULTS_CONTAINER_SELECTOR=".djs-search-results",_e.RESULT_SELECTOR=".djs-search-result",_e.RESULT_SELECTED_CLASS="djs-search-result-selected",_e.RESULT_SELECTED_SELECTOR="."+_e.RESULT_SELECTED_CLASS,_e.RESULT_ID_ATTRIBUTE="data-result-id",_e.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",_e.BOX_HTML=`<div class="djs-search-container djs-scrollable">
  224. <div class="djs-search-input">
  225. <svg class="djs-search-icon" width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
  226. <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"/>
  227. </svg>
  228. <input type="text" spellcheck="false" />
  229. </div>
  230. <div class="djs-search-results" />
  231. </div>`,_e.RESULT_HTML='<div class="djs-search-result"></div>',_e.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',_e.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>';const cS={__depends__:[Cs,Ts,Gn],searchPad:["type",_e]};function Md(e,t,n){this._elementRegistry=e,this._canvas=n,t.registerProvider(this)}function Nd(e){return"matched"in e}function Xl(e){return e.find(Nd)}function nb(e,t){const n=Xl(e),i=Xl(t);if(n&&!i)return-1;if(!n&&i)return 1;if(!n&&!i)return 0;const r=e.find(Nd),o=t.find(Nd);return r.index<o.index?-1:r.index>o.index?1:0}function ib(e="",t=""){return e.localeCompare(t)}function rb(e,t){var n=[],i=e;if(!e)return n;e=e.toLowerCase(),t=t.toLowerCase();var r=e.indexOf(t);return r>-1?(r!==0&&n.push({normal:i.slice(0,r),index:0}),n.push({matched:i.slice(r,r+t.length),index:r}),t.length+r<e.length&&n.push({normal:i.slice(r+t.length),index:r+t.length})):n.push({normal:i,index:0}),n}Md.$inject=["elementRegistry","searchPad","canvas"],Md.prototype.find=function(e){var t=this._canvas.getRootElements();return this._elementRegistry.filter(function(n){return!Re(n)&&!t.includes(n)}).reduce(function(n,i){var r=rb(tn(i),e),o=rb(i.id,e);return Xl(r)||Xl(o)?[...n,{primaryTokens:r,secondaryTokens:o,element:i}]:n},[]).sort(function(n,i){return nb(n.primaryTokens,i.primaryTokens)||nb(n.secondaryTokens,i.secondaryTokens)||ib(tn(n.element),tn(i.element))||ib(n.element.id,i.element.id)}).map(function(n){return{element:n.element,primaryTokens:n.primaryTokens.map(function(i){return cn(i,["index"])}),secondaryTokens:n.secondaryTokens.map(function(i){return cn(i,["index"])})}})};const uS={__depends__:[cS],__init__:["bpmnSearch"],bpmnSearch:["type",Md]};function Yn(e){Go.call(this,e)}le(Yn,Go),Yn.Viewer=si,Yn.NavigatedViewer=Qo,Yn.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>')},Yn.prototype._interactionModules=[Rf,Bf,Of],Yn.prototype._modelingModules=[t1,Ku,s1,o1,p1,ip,d1,Aw,mg,_l,Nw,Bw,Lw,jw,Vw,Uw,qw,i0,Yw,Jw,rS,oS,A0,lS,uS],Yn.prototype._modules=[].concat(si.prototype._modules,Yn.prototype._interactionModules,Yn.prototype._modelingModules);const pS={"Append EndEvent":"\u8FFD\u52A0\u7ED3\u675F\u4E8B\u4EF6","Append Gateway":"\u8FFD\u52A0\u7F51\u5173","Append Task":"\u8FFD\u52A0\u4EFB\u52A1","Append Intermediate/Boundary Event":"\u8FFD\u52A0\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6/\u8FB9\u754C\u4E8B\u4EF6","Activate the global connect tool":"\u6FC0\u6D3B\u5168\u5C40\u8FDE\u63A5\u5DE5\u5177","Append {type}":"\u6DFB\u52A0 {type}","Add Lane above":"\u5728\u4E0A\u9762\u6DFB\u52A0\u9053","Divide into two Lanes":"\u5206\u5272\u6210\u4E24\u4E2A\u9053","Divide into three Lanes":"\u5206\u5272\u6210\u4E09\u4E2A\u9053","Add Lane below":"\u5728\u4E0B\u9762\u6DFB\u52A0\u9053","Append compensation activity":"\u8FFD\u52A0\u8865\u507F\u6D3B\u52A8","Change type":"\u4FEE\u6539\u7C7B\u578B","Connect using Association":"\u4F7F\u7528\u5173\u8054\u8FDE\u63A5","Connect using Sequence/MessageFlow or Association":"\u4F7F\u7528\u987A\u5E8F/\u6D88\u606F\u6D41\u6216\u8005\u5173\u8054\u8FDE\u63A5","Connect using DataInputAssociation":"\u4F7F\u7528\u6570\u636E\u8F93\u5165\u5173\u8054\u8FDE\u63A5",Remove:"\u79FB\u9664","Activate the hand tool":"\u6FC0\u6D3B\u6293\u624B\u5DE5\u5177","Activate the lasso tool":"\u6FC0\u6D3B\u5957\u7D22\u5DE5\u5177","Activate the create/remove space tool":"\u6FC0\u6D3B\u521B\u5EFA/\u5220\u9664\u7A7A\u95F4\u5DE5\u5177","Create expanded SubProcess":"\u521B\u5EFA\u6269\u5C55\u5B50\u8FC7\u7A0B","Create IntermediateThrowEvent/BoundaryEvent":"\u521B\u5EFA\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6/\u8FB9\u754C\u4E8B\u4EF6","Create Pool/Participant":"\u521B\u5EFA\u6C60/\u53C2\u4E0E\u8005","Parallel Multi Instance":"\u5E76\u884C\u591A\u91CD\u4E8B\u4EF6","Sequential Multi Instance":"\u65F6\u5E8F\u591A\u91CD\u4E8B\u4EF6",DataObjectReference:"\u6570\u636E\u5BF9\u8C61\u53C2\u8003",DataStoreReference:"\u6570\u636E\u5B58\u50A8\u53C2\u8003",Loop:"\u5FAA\u73AF","Ad-hoc":"\u5373\u5E2D","Create {type}":"\u521B\u5EFA {type}",Task:"\u4EFB\u52A1","Send Task":"\u53D1\u9001\u4EFB\u52A1","Receive Task":"\u63A5\u6536\u4EFB\u52A1","User Task":"\u7528\u6237\u4EFB\u52A1","Manual Task":"\u624B\u5DE5\u4EFB\u52A1","Business Rule Task":"\u4E1A\u52A1\u89C4\u5219\u4EFB\u52A1","Service Task":"\u670D\u52A1\u4EFB\u52A1","Script Task":"\u811A\u672C\u4EFB\u52A1","Call Activity":"\u8C03\u7528\u6D3B\u52A8","Sub Process (collapsed)":"\u5B50\u6D41\u7A0B\uFF08\u6298\u53E0\u7684\uFF09","Sub Process (expanded)":"\u5B50\u6D41\u7A0B\uFF08\u5C55\u5F00\u7684\uFF09","Start Event":"\u5F00\u59CB\u4E8B\u4EF6",StartEvent:"\u5F00\u59CB\u4E8B\u4EF6","Intermediate Throw Event":"\u4E2D\u95F4\u4E8B\u4EF6","End Event":"\u7ED3\u675F\u4E8B\u4EF6",EndEvent:"\u7ED3\u675F\u4E8B\u4EF6","Create StartEvent":"\u521B\u5EFA\u5F00\u59CB\u4E8B\u4EF6","Create EndEvent":"\u521B\u5EFA\u7ED3\u675F\u4E8B\u4EF6","Create Task":"\u521B\u5EFA\u4EFB\u52A1","Create User Task":"\u521B\u5EFA\u7528\u6237\u4EFB\u52A1","Create Call Activity":"\u521B\u5EFA\u8C03\u7528\u6D3B\u52A8","Create Service Task":"\u521B\u5EFA\u670D\u52A1\u4EFB\u52A1","Create Gateway":"\u521B\u5EFA\u7F51\u5173","Create DataObjectReference":"\u521B\u5EFA\u6570\u636E\u5BF9\u8C61","Create DataStoreReference":"\u521B\u5EFA\u6570\u636E\u5B58\u50A8","Create Group":"\u521B\u5EFA\u5206\u7EC4","Create Intermediate/Boundary Event":"\u521B\u5EFA\u4E2D\u95F4/\u8FB9\u754C\u4E8B\u4EF6","Message Start Event":"\u6D88\u606F\u5F00\u59CB\u4E8B\u4EF6","Timer Start Event":"\u5B9A\u65F6\u5F00\u59CB\u4E8B\u4EF6","Conditional Start Event":"\u6761\u4EF6\u5F00\u59CB\u4E8B\u4EF6","Signal Start Event":"\u4FE1\u53F7\u5F00\u59CB\u4E8B\u4EF6","Error Start Event":"\u9519\u8BEF\u5F00\u59CB\u4E8B\u4EF6","Escalation Start Event":"\u5347\u7EA7\u5F00\u59CB\u4E8B\u4EF6","Compensation Start Event":"\u8865\u507F\u5F00\u59CB\u4E8B\u4EF6","Message Start Event (non-interrupting)":"\u6D88\u606F\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Timer Start Event (non-interrupting)":"\u5B9A\u65F6\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Conditional Start Event (non-interrupting)":"\u6761\u4EF6\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Signal Start Event (non-interrupting)":"\u4FE1\u53F7\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Escalation Start Event (non-interrupting)":"\u5347\u7EA7\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Message Intermediate Catch Event":"\u6D88\u606F\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Message Intermediate Throw Event":"\u6D88\u606F\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Timer Intermediate Catch Event":"\u5B9A\u65F6\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Escalation Intermediate Throw Event":"\u5347\u7EA7\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Conditional Intermediate Catch Event":"\u6761\u4EF6\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Link Intermediate Catch Event":"\u94FE\u63A5\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Link Intermediate Throw Event":"\u94FE\u63A5\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Compensation Intermediate Throw Event":"\u8865\u507F\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Signal Intermediate Catch Event":"\u4FE1\u53F7\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Signal Intermediate Throw Event":"\u4FE1\u53F7\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Message End Event":"\u6D88\u606F\u7ED3\u675F\u4E8B\u4EF6","Escalation End Event":"\u5B9A\u65F6\u7ED3\u675F\u4E8B\u4EF6","Error End Event":"\u9519\u8BEF\u7ED3\u675F\u4E8B\u4EF6","Cancel End Event":"\u53D6\u6D88\u7ED3\u675F\u4E8B\u4EF6","Compensation End Event":"\u8865\u507F\u7ED3\u675F\u4E8B\u4EF6","Signal End Event":"\u4FE1\u53F7\u7ED3\u675F\u4E8B\u4EF6","Terminate End Event":"\u7EC8\u6B62\u7ED3\u675F\u4E8B\u4EF6","Message Boundary Event":"\u6D88\u606F\u8FB9\u754C\u4E8B\u4EF6","Message Boundary Event (non-interrupting)":"\u6D88\u606F\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Timer Boundary Event":"\u5B9A\u65F6\u8FB9\u754C\u4E8B\u4EF6","Timer Boundary Event (non-interrupting)":"\u5B9A\u65F6\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Escalation Boundary Event":"\u5347\u7EA7\u8FB9\u754C\u4E8B\u4EF6","Escalation Boundary Event (non-interrupting)":"\u5347\u7EA7\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Conditional Boundary Event":"\u6761\u4EF6\u8FB9\u754C\u4E8B\u4EF6","Conditional Boundary Event (non-interrupting)":"\u6761\u4EF6\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Error Boundary Event":"\u9519\u8BEF\u8FB9\u754C\u4E8B\u4EF6","Cancel Boundary Event":"\u53D6\u6D88\u8FB9\u754C\u4E8B\u4EF6","Signal Boundary Event":"\u4FE1\u53F7\u8FB9\u754C\u4E8B\u4EF6","Signal Boundary Event (non-interrupting)":"\u4FE1\u53F7\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Compensation Boundary Event":"\u8865\u507F\u8FB9\u754C\u4E8B\u4EF6","Exclusive Gateway":"\u4E92\u65A5\u7F51\u5173","Parallel Gateway":"\u5E76\u884C\u7F51\u5173","Inclusive Gateway":"\u76F8\u5BB9\u7F51\u5173","Complex Gateway":"\u590D\u6742\u7F51\u5173","Event based Gateway":"\u4E8B\u4EF6\u7F51\u5173",Transaction:"\u8F6C\u8FD0","Sub Process":"\u5B50\u6D41\u7A0B","Event Sub Process":"\u4E8B\u4EF6\u5B50\u6D41\u7A0B","Collapsed Pool":"\u6298\u53E0\u6C60","Expanded Pool":"\u5C55\u5F00\u6C60","no parent for {element} in {parent}":"\u5728{parent}\u91CC\uFF0C{element}\u6CA1\u6709\u7236\u7C7B","no shape type specified":"\u6CA1\u6709\u6307\u5B9A\u7684\u5F62\u72B6\u7C7B\u578B","flow elements must be children of pools/participants":"\u6D41\u5143\u7D20\u5FC5\u987B\u662F\u6C60/\u53C2\u4E0E\u8005\u7684\u5B50\u7C7B","out of bounds release":"out of bounds release","more than {count} child lanes":"\u5B50\u9053\u5927\u4E8E{count} ","element required":"\u5143\u7D20\u4E0D\u80FD\u4E3A\u7A7A","diagram not part of bpmn:Definitions":"\u6D41\u7A0B\u56FE\u4E0D\u7B26\u5408bpmn\u89C4\u8303","no diagram to display":"\u6CA1\u6709\u53EF\u5C55\u793A\u7684\u6D41\u7A0B\u56FE","no process or collaboration to display":"\u6CA1\u6709\u53EF\u5C55\u793A\u7684\u6D41\u7A0B/\u534F\u4F5C","element {element} referenced by {referenced}#{property} not yet drawn":"\u7531{referenced}#{property}\u5F15\u7528\u7684{element}\u5143\u7D20\u4ECD\u672A\u7ED8\u5236","already rendered {element}":"{element} \u5DF2\u88AB\u6E32\u67D3","failed to import {element}":"\u5BFC\u5165{element}\u5931\u8D25",Id:"\u7F16\u53F7",Name:"\u540D\u79F0",General:"\u5E38\u89C4",Details:"\u8BE6\u60C5","Message Name":"\u6D88\u606F\u540D\u79F0",Message:"\u6D88\u606F",Initiator:"\u521B\u5EFA\u8005","Asynchronous Continuations":"\u6301\u7EED\u5F02\u6B65","Asynchronous Before":"\u5F02\u6B65\u524D","Asynchronous After":"\u5F02\u6B65\u540E","Job Configuration":"\u5DE5\u4F5C\u914D\u7F6E",Exclusive:"\u6392\u9664","Job Priority":"\u5DE5\u4F5C\u4F18\u5148\u7EA7","Retry Time Cycle":"\u91CD\u8BD5\u65F6\u95F4\u5468\u671F",Documentation:"\u6587\u6863","Element Documentation":"\u5143\u7D20\u6587\u6863","History Configuration":"\u5386\u53F2\u914D\u7F6E","History Time To Live":"\u5386\u53F2\u7684\u751F\u5B58\u65F6\u95F4",Forms:"\u8868\u5355","Form Key":"\u8868\u5355key","Form Fields":"\u8868\u5355\u5B57\u6BB5","Business Key":"\u4E1A\u52A1key","Form Field":"\u8868\u5355\u5B57\u6BB5",ID:"\u7F16\u53F7",Type:"\u7C7B\u578B",Label:"\u540D\u79F0","Default Value":"\u9ED8\u8BA4\u503C","Default Flow":"\u9ED8\u8BA4\u6D41\u8F6C\u8DEF\u5F84","Conditional Flow":"\u6761\u4EF6\u6D41\u8F6C\u8DEF\u5F84","Sequence Flow":"\u666E\u901A\u6D41\u8F6C\u8DEF\u5F84",Validation:"\u6821\u9A8C","Add Constraint":"\u6DFB\u52A0\u7EA6\u675F",Config:"\u914D\u7F6E",Properties:"\u5C5E\u6027","Add Property":"\u6DFB\u52A0\u5C5E\u6027",Value:"\u503C",Listeners:"\u76D1\u542C\u5668","Execution Listener":"\u6267\u884C\u76D1\u542C","Event Type":"\u4E8B\u4EF6\u7C7B\u578B","Listener Type":"\u76D1\u542C\u5668\u7C7B\u578B","Java Class":"Java\u7C7B",Expression:"\u8868\u8FBE\u5F0F","Must provide a value":"\u5FC5\u987B\u63D0\u4F9B\u4E00\u4E2A\u503C","Delegate Expression":"\u4EE3\u7406\u8868\u8FBE\u5F0F",Script:"\u811A\u672C","Script Format":"\u811A\u672C\u683C\u5F0F","Script Type":"\u811A\u672C\u7C7B\u578B","Inline Script":"\u5185\u8054\u811A\u672C","External Script":"\u5916\u90E8\u811A\u672C",Resource:"\u8D44\u6E90","Field Injection":"\u5B57\u6BB5\u6CE8\u5165",Extensions:"\u6269\u5C55","Input/Output":"\u8F93\u5165/\u8F93\u51FA","Input Parameters":"\u8F93\u5165\u53C2\u6570","Output Parameters":"\u8F93\u51FA\u53C2\u6570",Parameters:"\u53C2\u6570","Output Parameter":"\u8F93\u51FA\u53C2\u6570","Timer Definition Type":"\u5B9A\u65F6\u5668\u5B9A\u4E49\u7C7B\u578B","Timer Definition":"\u5B9A\u65F6\u5668\u5B9A\u4E49",Date:"\u65E5\u671F",Duration:"\u6301\u7EED",Cycle:"\u5FAA\u73AF",Signal:"\u4FE1\u53F7","Signal Name":"\u4FE1\u53F7\u540D\u79F0",Escalation:"\u5347\u7EA7",Error:"\u9519\u8BEF","Link Name":"\u94FE\u63A5\u540D\u79F0",Condition:"\u6761\u4EF6\u540D\u79F0","Variable Name":"\u53D8\u91CF\u540D\u79F0","Variable Event":"\u53D8\u91CF\u4E8B\u4EF6","Specify more than one variable change event as a comma separated list.":"\u591A\u4E2A\u53D8\u91CF\u4E8B\u4EF6\u4EE5\u9017\u53F7\u9694\u5F00","Wait for Completion":"\u7B49\u5F85\u5B8C\u6210","Activity Ref":"\u6D3B\u52A8\u53C2\u8003","Version Tag":"\u7248\u672C\u6807\u7B7E",Executable:"\u53EF\u6267\u884C\u6587\u4EF6","External Task Configuration":"\u6269\u5C55\u4EFB\u52A1\u914D\u7F6E","Task Priority":"\u4EFB\u52A1\u4F18\u5148\u7EA7",External:"\u5916\u90E8",Connector:"\u8FDE\u63A5\u5668","Must configure Connector":"\u5FC5\u987B\u914D\u7F6E\u8FDE\u63A5\u5668","Connector Id":"\u8FDE\u63A5\u5668\u7F16\u53F7",Implementation:"\u5B9E\u73B0\u65B9\u5F0F","Field Injections":"\u5B57\u6BB5\u6CE8\u5165",Fields:"\u5B57\u6BB5","Result Variable":"\u7ED3\u679C\u53D8\u91CF",Topic:"\u4E3B\u9898","Configure Connector":"\u914D\u7F6E\u8FDE\u63A5\u5668","Input Parameter":"\u8F93\u5165\u53C2\u6570",Assignee:"\u4EE3\u7406\u4EBA","Candidate Users":"\u5019\u9009\u7528\u6237","Candidate Groups":"\u5019\u9009\u7EC4","Due Date":"\u5230\u671F\u65F6\u95F4","Follow Up Date":"\u8DDF\u8E2A\u65E5\u671F",Priority:"\u4F18\u5148\u7EA7","The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"\u8DDF\u8E2A\u65E5\u671F\u5FC5\u987B\u7B26\u5408EL\u8868\u8FBE\u5F0F\uFF0C\u5982\uFF1A ${someDate} ,\u6216\u8005\u4E00\u4E2AISO\u6807\u51C6\u65E5\u671F\uFF0C\u5982\uFF1A2015-06-26T09:54:00","The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"\u8DDF\u8E2A\u65E5\u671F\u5FC5\u987B\u7B26\u5408EL\u8868\u8FBE\u5F0F\uFF0C\u5982\uFF1A ${someDate} ,\u6216\u8005\u4E00\u4E2AISO\u6807\u51C6\u65E5\u671F\uFF0C\u5982\uFF1A2015-06-26T09:54:00",Variables:"\u53D8\u91CF","Candidate Starter Configuration":"\u5019\u9009\u4EBA\u8D77\u52A8\u5668\u914D\u7F6E","Candidate Starter Groups":"\u5019\u9009\u4EBA\u8D77\u52A8\u5668\u7EC4","This maps to the process definition key.":"\u8FD9\u6620\u5C04\u5230\u6D41\u7A0B\u5B9A\u4E49\u952E\u3002","Candidate Starter Users":"\u5019\u9009\u4EBA\u8D77\u52A8\u5668\u7684\u7528\u6237","Specify more than one user as a comma separated list.":"\u6307\u5B9A\u591A\u4E2A\u7528\u6237\u4F5C\u4E3A\u9017\u53F7\u5206\u9694\u7684\u5217\u8868\u3002","Tasklist Configuration":"Tasklist\u914D\u7F6E",Startable:"\u542F\u52A8","Specify more than one group as a comma separated list.":"\u6307\u5B9A\u591A\u4E2A\u7EC4\u4F5C\u4E3A\u9017\u53F7\u5206\u9694\u7684\u5217\u8868\u3002"};var Yl,Id,ob={exports:{}};Yl=typeof window<"u"?window:Tx,Id=function(e,t){var n=(this!==void 0?this:e).SVG=function(l){if(n.supported)return l=new n.Doc(l),n.parser.draw||n.prepare(),l};if(n.ns="http://www.w3.org/2000/svg",n.xmlns="http://www.w3.org/2000/xmlns/",n.xlink="http://www.w3.org/1999/xlink",n.svgjs="http://svgjs.com/svgjs",n.supported=!!t.createElementNS&&!!t.createElementNS(n.ns,"svg").createSVGRect,!n.supported)return!1;n.did=1e3,n.eid=function(l){return"Svgjs"+d(l)+n.did++},n.create=function(l){var h=t.createElementNS(this.ns,l);return h.setAttribute("id",this.eid(l)),h},n.extend=function(){var l,h,y,x;for(h=(l=[].slice.call(arguments)).pop(),x=l.length-1;x>=0;x--)if(l[x])for(y in h)l[x].prototype[y]=h[y];n.Set&&n.Set.inherit&&n.Set.inherit()},n.invent=function(l){var h=typeof l.create=="function"?l.create:function(){this.constructor.call(this,n.create(l.create))};return l.inherit&&(h.prototype=new l.inherit),l.extend&&n.extend(h,l.extend),l.construct&&n.extend(l.parent||n.Container,l.construct),h},n.adopt=function(l){return l?l.instance?l.instance:((h=l.nodeName=="svg"?l.parentNode instanceof e.SVGElement?new n.Nested:new n.Doc:l.nodeName=="linearGradient"?new n.Gradient("linear"):l.nodeName=="radialGradient"?new n.Gradient("radial"):n[d(l.nodeName)]?new n[d(l.nodeName)]:new n.Element(l)).type=l.nodeName,h.node=l,l.instance=h,h instanceof n.Doc&&h.namespace().defs(),h.setData(JSON.parse(l.getAttribute("svgjs:data"))||{}),h):null;var h},n.prepare=function(){var l=t.getElementsByTagName("body")[0],h=(l?new n.Doc(l):n.adopt(t.documentElement).nested()).size(2,0);n.parser={body:l||t.documentElement,draw:h.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").attr("focusable","false").node,poly:h.polyline().node,path:h.path().node,native:n.create("svg")}},n.parser={native:n.create("svg")},t.addEventListener("DOMContentLoaded",function(){n.parser.draw||n.prepare()},!1),n.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},n.utils={map:function(l,h){var y,x=l.length,C=[];for(y=0;y<x;y++)C.push(h(l[y]));return C},filter:function(l,h){var y,x=l.length,C=[];for(y=0;y<x;y++)h(l[y])&&C.push(l[y]);return C},radians:function(l){return l%360*Math.PI/180},degrees:function(l){return 180*l/Math.PI%360},filterSVGElements:function(l){return this.filter(l,function(h){return h instanceof e.SVGElement})}},n.defaults={attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"}},n.Color=function(l){var h,y;this.r=0,this.g=0,this.b=0,l&&(typeof l=="string"?n.regex.isRgb.test(l)?(h=n.regex.rgb.exec(l.replace(n.regex.whitespace,"")),this.r=parseInt(h[1]),this.g=parseInt(h[2]),this.b=parseInt(h[3])):n.regex.isHex.test(l)&&(h=n.regex.hex.exec((y=l).length==4?["#",y.substring(1,2),y.substring(1,2),y.substring(2,3),y.substring(2,3),y.substring(3,4),y.substring(3,4)].join(""):y),this.r=parseInt(h[1],16),this.g=parseInt(h[2],16),this.b=parseInt(h[3],16)):typeof l=="object"&&(this.r=l.r,this.g=l.g,this.b=l.b))},n.extend(n.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+m(this.r)+m(this.g)+m(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(l){return this.destination=new n.Color(l),this},at:function(l){return this.destination?(l=l<0?0:l>1?1:l,new n.Color({r:~~(this.r+(this.destination.r-this.r)*l),g:~~(this.g+(this.destination.g-this.g)*l),b:~~(this.b+(this.destination.b-this.b)*l)})):this}}),n.Color.test=function(l){return l+="",n.regex.isHex.test(l)||n.regex.isRgb.test(l)},n.Color.isRgb=function(l){return l&&typeof l.r=="number"&&typeof l.g=="number"&&typeof l.b=="number"},n.Color.isColor=function(l){return n.Color.isRgb(l)||n.Color.test(l)},n.Array=function(l,h){(l=(l||[]).valueOf()).length==0&&h&&(l=h.valueOf()),this.value=this.parse(l)},n.extend(n.Array,{morph:function(l){if(this.destination=this.parse(l),this.value.length!=this.destination.length){for(var h=this.value[this.value.length-1],y=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(y);for(;this.value.length<this.destination.length;)this.value.push(h)}return this},settle:function(){for(var l=0,h=this.value.length,y=[];l<h;l++)y.indexOf(this.value[l])==-1&&y.push(this.value[l]);return this.value=y},at:function(l){if(!this.destination)return this;for(var h=0,y=this.value.length,x=[];h<y;h++)x.push(this.value[h]+(this.destination[h]-this.value[h])*l);return new n.Array(x)},toString:function(){return this.value.join(" ")},valueOf:function(){return this.value},parse:function(l){return l=l.valueOf(),Array.isArray(l)?l:this.split(l)},split:function(l){return l.trim().split(n.regex.delimiter).map(parseFloat)},reverse:function(){return this.value.reverse(),this},clone:function(){var l=new this.constructor;return l.value=u(this.value),l}}),n.PointArray=function(l,h){n.Array.call(this,l,h||[[0,0]])},n.PointArray.prototype=new n.Array,n.PointArray.prototype.constructor=n.PointArray,n.extend(n.PointArray,{toString:function(){for(var l=0,h=this.value.length,y=[];l<h;l++)y.push(this.value[l].join(","));return y.join(" ")},toLine:function(){return{x1:this.value[0][0],y1:this.value[0][1],x2:this.value[1][0],y2:this.value[1][1]}},at:function(l){if(!this.destination)return this;for(var h=0,y=this.value.length,x=[];h<y;h++)x.push([this.value[h][0]+(this.destination[h][0]-this.value[h][0])*l,this.value[h][1]+(this.destination[h][1]-this.value[h][1])*l]);return new n.PointArray(x)},parse:function(l){var h=[];if(l=l.valueOf(),Array.isArray(l)){if(Array.isArray(l[0]))return l.map(function(C){return C.slice()});if(l[0].x!=null)return l.map(function(C){return[C.x,C.y]})}else l=l.trim().split(n.regex.delimiter).map(parseFloat);l.length%2!=0&&l.pop();for(var y=0,x=l.length;y<x;y+=2)h.push([l[y],l[y+1]]);return h},move:function(l,h){var y=this.bbox();if(l-=y.x,h-=y.y,!isNaN(l)&&!isNaN(h))for(var x=this.value.length-1;x>=0;x--)this.value[x]=[this.value[x][0]+l,this.value[x][1]+h];return this},size:function(l,h){var y,x=this.bbox();for(y=this.value.length-1;y>=0;y--)x.width&&(this.value[y][0]=(this.value[y][0]-x.x)*l/x.width+x.x),x.height&&(this.value[y][1]=(this.value[y][1]-x.y)*h/x.height+x.y);return this},bbox:function(){return n.parser.poly.setAttribute("points",this.toString()),n.parser.poly.getBBox()}});for(var i={M:function(l,h,y){return h.x=y.x=l[0],h.y=y.y=l[1],["M",h.x,h.y]},L:function(l,h){return h.x=l[0],h.y=l[1],["L",l[0],l[1]]},H:function(l,h){return h.x=l[0],["H",l[0]]},V:function(l,h){return h.y=l[0],["V",l[0]]},C:function(l,h){return h.x=l[4],h.y=l[5],["C",l[0],l[1],l[2],l[3],l[4],l[5]]},S:function(l,h){return h.x=l[2],h.y=l[3],["S",l[0],l[1],l[2],l[3]]},Q:function(l,h){return h.x=l[2],h.y=l[3],["Q",l[0],l[1],l[2],l[3]]},T:function(l,h){return h.x=l[0],h.y=l[1],["T",l[0],l[1]]},Z:function(l,h,y){return h.x=y.x,h.y=y.y,["Z"]},A:function(l,h){return h.x=l[5],h.y=l[6],["A",l[0],l[1],l[2],l[3],l[4],l[5],l[6]]}},r="mlhvqtcsaz".split(""),o=0,a=r.length;o<a;++o)i[r[o]]=function(l){return function(h,y,x){if(l=="H")h[0]=h[0]+y.x;else if(l=="V")h[0]=h[0]+y.y;else if(l=="A")h[5]=h[5]+y.x,h[6]=h[6]+y.y;else for(var C=0,N=h.length;C<N;++C)h[C]=h[C]+(C%2?y.y:y.x);return i[l](h,y,x)}}(r[o].toUpperCase());n.PathArray=function(l,h){n.Array.call(this,l,h||[["M",0,0]])},n.PathArray.prototype=new n.Array,n.PathArray.prototype.constructor=n.PathArray,n.extend(n.PathArray,{toString:function(){return function(l){for(var h=0,y=l.length,x="";h<y;h++)x+=l[h][0],l[h][1]!=null&&(x+=l[h][1],l[h][2]!=null&&(x+=" ",x+=l[h][2],l[h][3]!=null&&(x+=" ",x+=l[h][3],x+=" ",x+=l[h][4],l[h][5]!=null&&(x+=" ",x+=l[h][5],x+=" ",x+=l[h][6],l[h][7]!=null&&(x+=" ",x+=l[h][7])))));return x+" "}(this.value)},move:function(l,h){var y=this.bbox();if(l-=y.x,h-=y.y,!isNaN(l)&&!isNaN(h))for(var x,C=this.value.length-1;C>=0;C--)(x=this.value[C][0])=="M"||x=="L"||x=="T"?(this.value[C][1]+=l,this.value[C][2]+=h):x=="H"?this.value[C][1]+=l:x=="V"?this.value[C][1]+=h:x=="C"||x=="S"||x=="Q"?(this.value[C][1]+=l,this.value[C][2]+=h,this.value[C][3]+=l,this.value[C][4]+=h,x=="C"&&(this.value[C][5]+=l,this.value[C][6]+=h)):x=="A"&&(this.value[C][6]+=l,this.value[C][7]+=h);return this},size:function(l,h){var y,x,C=this.bbox();for(y=this.value.length-1;y>=0;y--)(x=this.value[y][0])=="M"||x=="L"||x=="T"?(this.value[y][1]=(this.value[y][1]-C.x)*l/C.width+C.x,this.value[y][2]=(this.value[y][2]-C.y)*h/C.height+C.y):x=="H"?this.value[y][1]=(this.value[y][1]-C.x)*l/C.width+C.x:x=="V"?this.value[y][1]=(this.value[y][1]-C.y)*h/C.height+C.y:x=="C"||x=="S"||x=="Q"?(this.value[y][1]=(this.value[y][1]-C.x)*l/C.width+C.x,this.value[y][2]=(this.value[y][2]-C.y)*h/C.height+C.y,this.value[y][3]=(this.value[y][3]-C.x)*l/C.width+C.x,this.value[y][4]=(this.value[y][4]-C.y)*h/C.height+C.y,x=="C"&&(this.value[y][5]=(this.value[y][5]-C.x)*l/C.width+C.x,this.value[y][6]=(this.value[y][6]-C.y)*h/C.height+C.y)):x=="A"&&(this.value[y][1]=this.value[y][1]*l/C.width,this.value[y][2]=this.value[y][2]*h/C.height,this.value[y][6]=(this.value[y][6]-C.x)*l/C.width+C.x,this.value[y][7]=(this.value[y][7]-C.y)*h/C.height+C.y);return this},equalCommands:function(l){var h,y,x;for(l=new n.PathArray(l),x=this.value.length===l.value.length,h=0,y=this.value.length;x&&h<y;h++)x=this.value[h][0]===l.value[h][0];return x},morph:function(l){return l=new n.PathArray(l),this.equalCommands(l)?this.destination=l:this.destination=null,this},at:function(l){if(!this.destination)return this;var h,y,x,C,N=this.value,O=this.destination.value,B=[],H=new n.PathArray;for(h=0,y=N.length;h<y;h++){for(B[h]=[N[h][0]],x=1,C=N[h].length;x<C;x++)B[h][x]=N[h][x]+(O[h][x]-N[h][x])*l;B[h][0]==="A"&&(B[h][4]=+(B[h][4]!=0),B[h][5]=+(B[h][5]!=0))}return H.value=B,H},parse:function(l){if(l instanceof n.PathArray)return l.valueOf();var h,y={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};l=typeof l=="string"?l.replace(n.regex.numbersWithDots,c).replace(n.regex.pathLetters," $& ").replace(n.regex.hyphen,"$1 -").trim().split(n.regex.delimiter):l.reduce(function(H,q){return[].concat.call(H,q)},[]);var x=[],C=new n.Point,N=new n.Point,O=0,B=l.length;do n.regex.isPathLetter.test(l[O])?(h=l[O],++O):h=="M"?h="L":h=="m"&&(h="l"),x.push(i[h].call(null,l.slice(O,O+=y[h.toUpperCase()]).map(parseFloat),C,N));while(B>O);return x},bbox:function(){return n.parser.path.setAttribute("d",this.toString()),n.parser.path.getBBox()}}),n.Number=n.invent({create:function(l,h){this.value=0,this.unit=h||"",typeof l=="number"?this.value=isNaN(l)?0:isFinite(l)?l:l<0?-34e37:34e37:typeof l=="string"?(h=l.match(n.regex.numberAndUnit))&&(this.value=parseFloat(h[1]),h[5]=="%"?this.value/=100:h[5]=="s"&&(this.value*=1e3),this.unit=h[5]):l instanceof n.Number&&(this.value=l.valueOf(),this.unit=l.unit)},extend:{toString:function(){return(this.unit=="%"?~~(1e8*this.value)/1e6:this.unit=="s"?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(l){return l=new n.Number(l),new n.Number(this+l,this.unit||l.unit)},minus:function(l){return l=new n.Number(l),new n.Number(this-l,this.unit||l.unit)},times:function(l){return l=new n.Number(l),new n.Number(this*l,this.unit||l.unit)},divide:function(l){return l=new n.Number(l),new n.Number(this/l,this.unit||l.unit)},to:function(l){var h=new n.Number(this);return typeof l=="string"&&(h.unit=l),h},morph:function(l){return this.destination=new n.Number(l),l.relative&&(this.destination.value+=this.value),this},at:function(l){return this.destination?new n.Number(this.destination).minus(this).times(l).plus(this):this}}}),n.Element=n.invent({create:function(l){this._stroke=n.defaults.attrs.stroke,this._event=null,this._events={},this.dom={},(this.node=l)&&(this.type=l.nodeName,this.node.instance=this,this._events=l._events||{},this._stroke=l.getAttribute("stroke")||this._stroke)},extend:{x:function(l){return this.attr("x",l)},y:function(l){return this.attr("y",l)},cx:function(l){return l==null?this.x()+this.width()/2:this.x(l-this.width()/2)},cy:function(l){return l==null?this.y()+this.height()/2:this.y(l-this.height()/2)},move:function(l,h){return this.x(l).y(h)},center:function(l,h){return this.cx(l).cy(h)},width:function(l){return this.attr("width",l)},height:function(l){return this.attr("height",l)},size:function(l,h){var y=f(this,l,h);return this.width(new n.Number(y.width)).height(new n.Number(y.height))},clone:function(l){this.writeDataToDom();var h=_(this.node.cloneNode(!0));return l?l.add(h):this.after(h),h},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(l){return this.after(l).remove(),l},addTo:function(l){return l.put(this)},putIn:function(l){return l.add(this)},id:function(l){return this.attr("id",l)},inside:function(l,h){var y=this.bbox();return l>y.x&&h>y.y&&l<y.x+y.width&&h<y.y+y.height},show:function(){return this.style("display","")},hide:function(){return this.style("display","none")},visible:function(){return this.style("display")!="none"},toString:function(){return this.attr("id")},classes:function(){var l=this.attr("class");return l==null?[]:l.trim().split(n.regex.delimiter)},hasClass:function(l){return this.classes().indexOf(l)!=-1},addClass:function(l){if(!this.hasClass(l)){var h=this.classes();h.push(l),this.attr("class",h.join(" "))}return this},removeClass:function(l){return this.hasClass(l)&&this.attr("class",this.classes().filter(function(h){return h!=l}).join(" ")),this},toggleClass:function(l){return this.hasClass(l)?this.removeClass(l):this.addClass(l)},reference:function(l){return n.get(this.attr(l))},parent:function(l){var h=this;if(!h.node.parentNode)return null;if(h=n.adopt(h.node.parentNode),!l)return h;for(;h&&h.node instanceof e.SVGElement;){if(typeof l=="string"?h.matches(l):h instanceof l)return h;if(!h.node.parentNode||h.node.parentNode.nodeName=="#document"||h.node.parentNode.nodeName=="#document-fragment")return null;h=n.adopt(h.node.parentNode)}},doc:function(){return this instanceof n.Doc?this:this.parent(n.Doc)},parents:function(l){var h=[],y=this;do{if(!(y=y.parent(l))||!y.node)break;h.push(y)}while(y.parent);return h},matches:function(l){return function(h,y){return(h.matches||h.matchesSelector||h.msMatchesSelector||h.mozMatchesSelector||h.webkitMatchesSelector||h.oMatchesSelector).call(h,y)}(this.node,l)},native:function(){return this.node},svg:function(l){var h=t.createElement("svg");if(!(l&&this instanceof n.Parent))return h.appendChild(l=t.createElement("svg")),this.writeDataToDom(),l.appendChild(this.node.cloneNode(!0)),h.innerHTML.replace(/^<svg>/,"").replace(/<\/svg>$/,"");h.innerHTML="<svg>"+l.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2></$1>")+"</svg>";for(var y=0,x=h.firstChild.childNodes.length;y<x;y++)this.node.appendChild(h.firstChild.firstChild);return this},writeDataToDom:function(){return(this.each||this.lines)&&(this.each?this:this.lines()).each(function(){this.writeDataToDom()}),this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(l){return this.dom=l,this},is:function(l){return function(h,y){return h instanceof y}(this,l)}}}),n.easing={"-":function(l){return l},"<>":function(l){return-Math.cos(l*Math.PI)/2+.5},">":function(l){return Math.sin(l*Math.PI/2)},"<":function(l){return 1-Math.cos(l*Math.PI/2)}},n.morph=function(l){return function(h,y){return new n.MorphObj(h,y).at(l)}},n.Situation=n.invent({create:function(l){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new n.Number(l.duration).valueOf(),this.delay=new n.Number(l.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=l.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),n.FX=n.invent({create:function(l){this._target=l,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(l,h,y){typeof l=="object"&&(h=l.ease,y=l.delay,l=l.duration);var x=new n.Situation({duration:l||1e3,delay:y||0,ease:n.easing[h||"-"]||h});return this.queue(x),this},delay:function(l){var h=new n.Situation({duration:l,delay:0,ease:n.easing["-"]});return this.queue(h)},target:function(l){return l&&l instanceof n.Element?(this._target=l,this):this._target},timeToAbsPos:function(l){return(l-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(l){return this.situation.duration/this._speed*l+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=e.requestAnimationFrame((function(){this.step()}).bind(this))},stopAnimFrame:function(){e.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(l){return(typeof l=="function"||l instanceof n.Situation)&&this.situations.push(l),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof n.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var l,h,y,x=this.situation;if(x.init)return this;for(l in x.animations)for(y=this.target()[l](),Array.isArray(y)||(y=[y]),Array.isArray(x.animations[l])||(x.animations[l]=[x.animations[l]]),h=y.length;h--;)x.animations[l][h]instanceof n.Number&&(y[h]=new n.Number(y[h])),x.animations[l][h]=y[h].morph(x.animations[l][h]);for(l in x.attrs)x.attrs[l]=new n.MorphObj(this.target().attr(l),x.attrs[l]);for(l in x.styles)x.styles[l]=new n.MorphObj(this.target().style(l),x.styles[l]);return x.initialTransformation=this.target().matrixify(),x.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(l,h){var y=this.active;return this.active=!1,h&&this.clearQueue(),l&&this.situation&&(!y&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){if(this.situation){var l=this.situation;this.stop(),this.situation=l,this.atStart()}return this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return this.situation.loops===!0&&(this.situation.loops=this.situation.loop+1),typeof this.situation.loops=="number"?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(l,h){var y=this.situation.duration/this._speed;return this.absPos=l,h||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*y,this.situation.finish=this.situation.start+y,this.step(!0)},speed:function(l){return l===0?this.pause():l?(this._speed=l,this.at(this.absPos,!0)):this._speed},loop:function(l,h){var y=this.last();return y.loops=l==null||l,y.loop=0,h&&(y.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(l){var h=this.last();return h.reversed=l===void 0?!h.reversed:l,this},progress:function(l){return l?this.situation.ease(this.pos):this.pos},after:function(l){var h=this.last();return this.target().on("finished.fx",function y(x){x.detail.situation==h&&(l.call(this,h),this.off("finished.fx",y))}),this._callStart()},during:function(l){var h=this.last(),y=function(x){x.detail.situation==h&&l.call(this,x.detail.pos,n.morph(x.detail.pos),x.detail.eased,h)};return this.target().off("during.fx",y).on("during.fx",y),this.after(function(){this.off("during.fx",y)}),this._callStart()},afterAll:function(l){var h=function y(x){l.call(this),this.off("allfinished.fx",y)};return this.target().off("allfinished.fx",h).on("allfinished.fx",h),this._callStart()},duringAll:function(l){var h=function(y){l.call(this,y.detail.pos,n.morph(y.detail.pos),y.detail.eased,y.detail.situation)};return this.target().off("during.fx",h).on("during.fx",h),this.afterAll(function(){this.off("during.fx",h)}),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(l,h,y){return this.last()[y||"animations"][l]=h,this._callStart()},step:function(l){var h,y,x;l||(this.absPos=this.timeToAbsPos(+new Date)),this.situation.loops!==!1?(h=Math.max(this.absPos,0),y=Math.floor(h),this.situation.loops===!0||y<this.situation.loops?(this.pos=h-y,x=this.situation.loop,this.situation.loop=y):(this.absPos=this.situation.loops,this.pos=1,x=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=!!((this.situation.loop-x)%2))):(this.absPos=Math.min(this.absPos,1),this.pos=this.absPos),this.pos<0&&(this.pos=0),this.situation.reversed&&(this.pos=1-this.pos);var C=this.situation.ease(this.pos);for(var N in this.situation.once)N>this.lastPos&&N<=C&&(this.situation.once[N].call(this.target(),this.pos,C),delete this.situation.once[N]);return this.active&&this.target().fire("during",{pos:this.pos,eased:C,fx:this,situation:this.situation}),this.situation?(this.eachAt(),this.pos==1&&!this.situation.reversed||this.situation.reversed&&this.pos==0?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=C,this):this},eachAt:function(){var l,h,y,x=this,C=this.target(),N=this.situation;for(l in N.animations)y=[].concat(N.animations[l]).map(function(B){return typeof B!="string"&&B.at?B.at(N.ease(x.pos),x.pos):B}),C[l].apply(C,y);for(l in N.attrs)y=[l].concat(N.attrs[l]).map(function(B){return typeof B!="string"&&B.at?B.at(N.ease(x.pos),x.pos):B}),C.attr.apply(C,y);for(l in N.styles)y=[l].concat(N.styles[l]).map(function(B){return typeof B!="string"&&B.at?B.at(N.ease(x.pos),x.pos):B}),C.style.apply(C,y);if(N.transforms.length){for(y=N.initialTransformation,l=0,h=N.transforms.length;l<h;l++){var O=N.transforms[l];O instanceof n.Matrix?y=O.relative?y.multiply(new n.Matrix().morph(O).at(N.ease(this.pos))):y.morph(O).at(N.ease(this.pos)):(O.relative||O.undo(y.extract()),y=y.multiply(O.at(N.ease(this.pos))))}C.matrix(y)}return this},once:function(l,h,y){var x=this.last();return y||(l=x.ease(l)),x.once[l]=h,this},_callStart:function(){return setTimeout((function(){this.start()}).bind(this),0),this}},parent:n.Element,construct:{animate:function(l,h,y){return(this.fx||(this.fx=new n.FX(this))).animate(l,h,y)},delay:function(l){return(this.fx||(this.fx=new n.FX(this))).delay(l)},stop:function(l,h){return this.fx&&this.fx.stop(l,h),this},finish:function(){return this.fx&&this.fx.finish(),this},pause:function(){return this.fx&&this.fx.pause(),this},play:function(){return this.fx&&this.fx.play(),this},speed:function(l){if(this.fx){if(l==null)return this.fx.speed();this.fx.speed(l)}return this}}}),n.MorphObj=n.invent({create:function(l,h){return n.Color.isColor(h)?new n.Color(l).morph(h):n.regex.delimiter.test(l)?n.regex.pathLetters.test(l)?new n.PathArray(l).morph(h):new n.Array(l).morph(h):n.regex.numberAndUnit.test(h)?new n.Number(l).morph(h):(this.value=l,void(this.destination=h))},extend:{at:function(l,h){return h<1?this.value:this.destination},valueOf:function(){return this.value}}}),n.extend(n.FX,{attr:function(l,h,y){if(typeof l=="object")for(var x in l)this.attr(x,l[x]);else this.add(l,h,"attrs");return this},style:function(l,h){if(typeof l=="object")for(var y in l)this.style(y,l[y]);else this.add(l,h,"styles");return this},x:function(l,h){if(this.target()instanceof n.G)return this.transform({x:l},h),this;var y=new n.Number(l);return y.relative=h,this.add("x",y)},y:function(l,h){if(this.target()instanceof n.G)return this.transform({y:l},h),this;var y=new n.Number(l);return y.relative=h,this.add("y",y)},cx:function(l){return this.add("cx",new n.Number(l))},cy:function(l){return this.add("cy",new n.Number(l))},move:function(l,h){return this.x(l).y(h)},center:function(l,h){return this.cx(l).cy(h)},size:function(l,h){var y;return this.target()instanceof n.Text?this.attr("font-size",l):(l&&h||(y=this.target().bbox()),l||(l=y.width/y.height*h),h||(h=y.height/y.width*l),this.add("width",new n.Number(l)).add("height",new n.Number(h))),this},width:function(l){return this.add("width",new n.Number(l))},height:function(l){return this.add("height",new n.Number(l))},plot:function(l,h,y,x){return arguments.length==4?this.plot([l,h,y,x]):this.add("plot",new(this.target()).morphArray(l))},leading:function(l){return this.target().leading?this.add("leading",new n.Number(l)):this},viewbox:function(l,h,y,x){return this.target()instanceof n.Container&&this.add("viewbox",new n.ViewBox(l,h,y,x)),this},update:function(l){if(this.target()instanceof n.Stop){if(typeof l=="number"||l instanceof n.Number)return this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]});l.opacity!=null&&this.attr("stop-opacity",l.opacity),l.color!=null&&this.attr("stop-color",l.color),l.offset!=null&&this.attr("offset",l.offset)}return this}}),n.Box=n.invent({create:function(l,h,y,x){if(!(typeof l!="object"||l instanceof n.Element))return n.Box.call(this,l.left!=null?l.left:l.x,l.top!=null?l.top:l.y,l.width,l.height);arguments.length==4&&(this.x=l,this.y=h,this.width=y,this.height=x),b(this)},extend:{merge:function(l){var h=new this.constructor;return h.x=Math.min(this.x,l.x),h.y=Math.min(this.y,l.y),h.width=Math.max(this.x+this.width,l.x+l.width)-h.x,h.height=Math.max(this.y+this.height,l.y+l.height)-h.y,b(h)},transform:function(l){var h,y=1/0,x=-1/0,C=1/0,N=-1/0;return[new n.Point(this.x,this.y),new n.Point(this.x2,this.y),new n.Point(this.x,this.y2),new n.Point(this.x2,this.y2)].forEach(function(O){O=O.transform(l),y=Math.min(y,O.x),x=Math.max(x,O.x),C=Math.min(C,O.y),N=Math.max(N,O.y)}),(h=new this.constructor).x=y,h.width=x-y,h.y=C,h.height=N-C,b(h),h}}}),n.BBox=n.invent({create:function(l){if(n.Box.apply(this,[].slice.call(arguments)),l instanceof n.Element){var h;try{if(t.documentElement.contains){if(!t.documentElement.contains(l.node))throw new Exception("Element not in the dom")}else{for(var y=l.node;y.parentNode;)y=y.parentNode;if(y!=t)throw new Exception("Element not in the dom")}h=l.node.getBBox()}catch{if(l instanceof n.Shape){var x=l.clone(n.parser.draw.instance).show();h=x.node.getBBox(),x.remove()}else h={x:l.node.clientLeft,y:l.node.clientTop,width:l.node.clientWidth,height:l.node.clientHeight}}n.Box.call(this,h)}},inherit:n.Box,parent:n.Element,construct:{bbox:function(){return new n.BBox(this)}}}),n.BBox.prototype.constructor=n.BBox,n.extend(n.Element,{tbox:function(){return console.warn("Use of TBox is deprecated and mapped to RBox. Use .rbox() instead."),this.rbox(this.doc())}}),n.RBox=n.invent({create:function(l){n.Box.apply(this,[].slice.call(arguments)),l instanceof n.Element&&n.Box.call(this,l.node.getBoundingClientRect())},inherit:n.Box,parent:n.Element,extend:{addOffset:function(){return this.x+=e.pageXOffset,this.y+=e.pageYOffset,this}},construct:{rbox:function(l){return l?new n.RBox(this).transform(l.screenCTM().inverse()):new n.RBox(this).addOffset()}}}),n.RBox.prototype.constructor=n.RBox,n.Matrix=n.invent({create:function(l){var h,y=g([1,0,0,1,0,0]);for(l=l instanceof n.Element?l.matrixify():typeof l=="string"?g(l.split(n.regex.delimiter).map(parseFloat)):arguments.length==6?g([].slice.call(arguments)):Array.isArray(l)?g(l):typeof l=="object"?l:y,h=S.length-1;h>=0;--h)this[S[h]]=l[S[h]]!=null?l[S[h]]:y[S[h]]},extend:{extract:function(){var l=v(this,0,1),h=v(this,1,0),y=180/Math.PI*Math.atan2(l.y,l.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(y*Math.PI/180)+this.f*Math.sin(y*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(y*Math.PI/180)+this.e*Math.sin(-y*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),skewX:-y,skewY:180/Math.PI*Math.atan2(h.y,h.x),scaleX:Math.sqrt(this.a*this.a+this.b*this.b),scaleY:Math.sqrt(this.c*this.c+this.d*this.d),rotation:y,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new n.Matrix(this)}},clone:function(){return new n.Matrix(this)},morph:function(l){return this.destination=new n.Matrix(l),this},at:function(l){return this.destination?new n.Matrix({a:this.a+(this.destination.a-this.a)*l,b:this.b+(this.destination.b-this.b)*l,c:this.c+(this.destination.c-this.c)*l,d:this.d+(this.destination.d-this.d)*l,e:this.e+(this.destination.e-this.e)*l,f:this.f+(this.destination.f-this.f)*l}):this},multiply:function(l){return new n.Matrix(this.native().multiply(function(h){return h instanceof n.Matrix||(h=new n.Matrix(h)),h}(l).native()))},inverse:function(){return new n.Matrix(this.native().inverse())},translate:function(l,h){return new n.Matrix(this.native().translate(l||0,h||0))},scale:function(l,h,y,x){return arguments.length==1?h=l:arguments.length==3&&(x=y,y=h,h=l),this.around(y,x,new n.Matrix(l,0,0,h,0,0))},rotate:function(l,h,y){return l=n.utils.radians(l),this.around(h,y,new n.Matrix(Math.cos(l),Math.sin(l),-Math.sin(l),Math.cos(l),0,0))},flip:function(l,h){return l=="x"?this.scale(-1,1,h,0):l=="y"?this.scale(1,-1,0,h):this.scale(-1,-1,l,h??l)},skew:function(l,h,y,x){return arguments.length==1?h=l:arguments.length==3&&(x=y,y=h,h=l),l=n.utils.radians(l),h=n.utils.radians(h),this.around(y,x,new n.Matrix(1,Math.tan(h),Math.tan(l),1,0,0))},skewX:function(l,h,y){return this.skew(l,0,h,y)},skewY:function(l,h,y){return this.skew(0,l,h,y)},around:function(l,h,y){return this.multiply(new n.Matrix(1,0,0,1,l||0,h||0)).multiply(y).multiply(new n.Matrix(1,0,0,1,-l||0,-h||0))},native:function(){for(var l=n.parser.native.createSVGMatrix(),h=S.length-1;h>=0;h--)l[S[h]]=this[S[h]];return l},toString:function(){return"matrix("+w(this.a)+","+w(this.b)+","+w(this.c)+","+w(this.d)+","+w(this.e)+","+w(this.f)+")"}},parent:n.Element,construct:{ctm:function(){return new n.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof n.Nested){var l=this.rect(1,1),h=l.node.getScreenCTM();return l.remove(),new n.Matrix(h)}return new n.Matrix(this.node.getScreenCTM())}}}),n.Point=n.invent({create:function(l,h){var y;y=Array.isArray(l)?{x:l[0],y:l[1]}:typeof l=="object"?{x:l.x,y:l.y}:l!=null?{x:l,y:h??l}:{x:0,y:0},this.x=y.x,this.y=y.y},extend:{clone:function(){return new n.Point(this)},morph:function(l,h){return this.destination=new n.Point(l,h),this},at:function(l){return this.destination?new n.Point({x:this.x+(this.destination.x-this.x)*l,y:this.y+(this.destination.y-this.y)*l}):this},native:function(){var l=n.parser.native.createSVGPoint();return l.x=this.x,l.y=this.y,l},transform:function(l){return new n.Point(this.native().matrixTransform(l.native()))}}}),n.extend(n.Element,{point:function(l,h){return new n.Point(l,h).transform(this.screenCTM().inverse())}}),n.extend(n.Element,{attr:function(l,h,y){if(l==null){for(l={},y=(h=this.node.attributes).length-1;y>=0;y--)l[h[y].nodeName]=n.regex.isNumber.test(h[y].nodeValue)?parseFloat(h[y].nodeValue):h[y].nodeValue;return l}if(typeof l=="object")for(h in l)this.attr(h,l[h]);else if(h===null)this.node.removeAttribute(l);else{if(h==null)return(h=this.node.getAttribute(l))==null?n.defaults.attrs[l]:n.regex.isNumber.test(h)?parseFloat(h):h;l=="stroke-width"?this.attr("stroke",parseFloat(h)>0?this._stroke:null):l=="stroke"&&(this._stroke=h),l!="fill"&&l!="stroke"||(n.regex.isImage.test(h)&&(h=this.doc().defs().image(h,0,0)),h instanceof n.Image&&(h=this.doc().defs().pattern(0,0,function(){this.add(h)}))),typeof h=="number"?h=new n.Number(h):n.Color.isColor(h)?h=new n.Color(h):Array.isArray(h)&&(h=new n.Array(h)),l=="leading"?this.leading&&this.leading(h):typeof y=="string"?this.node.setAttributeNS(y,l,h.toString()):this.node.setAttribute(l,h.toString()),!this.rebuild||l!="font-size"&&l!="x"||this.rebuild(l,h)}return this}}),n.extend(n.Element,{transform:function(l,h){var y,x,C=this;if(typeof l!="object")return y=new n.Matrix(C).extract(),typeof l=="string"?y[l]:y;if(y=new n.Matrix(C),h=!!h||!!l.relative,l.a!=null)y=h?y.multiply(new n.Matrix(l)):new n.Matrix(l);else if(l.rotation!=null)E(l,C),y=h?y.rotate(l.rotation,l.cx,l.cy):y.rotate(l.rotation-y.extract().rotation,l.cx,l.cy);else if(l.scale!=null||l.scaleX!=null||l.scaleY!=null){if(E(l,C),l.scaleX=l.scale!=null?l.scale:l.scaleX!=null?l.scaleX:1,l.scaleY=l.scale!=null?l.scale:l.scaleY!=null?l.scaleY:1,!h){var N=y.extract();l.scaleX=1*l.scaleX/N.scaleX,l.scaleY=1*l.scaleY/N.scaleY}y=y.scale(l.scaleX,l.scaleY,l.cx,l.cy)}else l.skew!=null||l.skewX!=null||l.skewY!=null?(E(l,C),l.skewX=l.skew!=null?l.skew:l.skewX!=null?l.skewX:0,l.skewY=l.skew!=null?l.skew:l.skewY!=null?l.skewY:0,h||(N=y.extract(),y=y.multiply(new n.Matrix().skew(N.skewX,N.skewY,l.cx,l.cy).inverse())),y=y.skew(l.skewX,l.skewY,l.cx,l.cy)):l.flip?(l.flip=="x"||l.flip=="y"?l.offset=l.offset==null?C.bbox()["c"+l.flip]:l.offset:l.offset==null?(x=C.bbox(),l.flip=x.cx,l.offset=x.cy):l.flip=l.offset,y=new n.Matrix().flip(l.flip,l.offset)):l.x==null&&l.y==null||(h?y=y.translate(l.x,l.y):(l.x!=null&&(y.e=l.x),l.y!=null&&(y.f=l.y)));return this.attr("transform",y)}}),n.extend(n.FX,{transform:function(l,h){var y,x,C=this.target();return typeof l!="object"?(y=new n.Matrix(C).extract(),typeof l=="string"?y[l]:y):(h=!!h||!!l.relative,l.a!=null?y=new n.Matrix(l):l.rotation!=null?(E(l,C),y=new n.Rotate(l.rotation,l.cx,l.cy)):l.scale!=null||l.scaleX!=null||l.scaleY!=null?(E(l,C),l.scaleX=l.scale!=null?l.scale:l.scaleX!=null?l.scaleX:1,l.scaleY=l.scale!=null?l.scale:l.scaleY!=null?l.scaleY:1,y=new n.Scale(l.scaleX,l.scaleY,l.cx,l.cy)):l.skewX!=null||l.skewY!=null?(E(l,C),l.skewX=l.skewX!=null?l.skewX:0,l.skewY=l.skewY!=null?l.skewY:0,y=new n.Skew(l.skewX,l.skewY,l.cx,l.cy)):l.flip?(l.flip=="x"||l.flip=="y"?l.offset=l.offset==null?C.bbox()["c"+l.flip]:l.offset:l.offset==null?(x=C.bbox(),l.flip=x.cx,l.offset=x.cy):l.flip=l.offset,y=new n.Matrix().flip(l.flip,l.offset)):l.x==null&&l.y==null||(y=new n.Translate(l.x,l.y)),y?(y.relative=h,this.last().transforms.push(y),this._callStart()):this)}}),n.extend(n.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){var l=(this.attr("transform")||"").split(n.regex.transforms).slice(0,-1).map(function(h){var y=h.trim().split("(");return[y[0],y[1].split(n.regex.delimiter).map(function(x){return parseFloat(x)})]}).reduce(function(h,y){return y[0]=="matrix"?h.multiply(g(y[1])):h[y[0]].apply(h,y[1])},new n.Matrix);return l},toParent:function(l){if(this==l)return this;var h=this.screenCTM(),y=l.screenCTM().inverse();return this.addTo(l).untransform().transform(y.multiply(h)),this},toDoc:function(){return this.toParent(this.doc())}}),n.Transformation=n.invent({create:function(l,h){if(arguments.length>1&&typeof h!="boolean")return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(l))for(var y=0,x=this.arguments.length;y<x;++y)this[this.arguments[y]]=l[y];else if(typeof l=="object")for(y=0,x=this.arguments.length;y<x;++y)this[this.arguments[y]]=l[this.arguments[y]];this.inversed=!1,h===!0&&(this.inversed=!0)},extend:{arguments:[],method:"",at:function(l){for(var h=[],y=0,x=this.arguments.length;y<x;++y)h.push(this[this.arguments[y]]);var C=this._undo||new n.Matrix;return C=new n.Matrix().morph(n.Matrix.prototype[this.method].apply(C,h)).at(l),this.inversed?C.inverse():C},undo:function(l){for(var h=0,y=this.arguments.length;h<y;++h)l[this.arguments[h]]=this[this.arguments[h]]===void 0?0:l[this.arguments[h]];return l.cx=this.cx,l.cy=this.cy,this._undo=new n[d(this.method)](l,!0).at(1),this}}}),n.Translate=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(l,h){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),n.Rotate=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(l,h){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["rotation","cx","cy"],method:"rotate",at:function(l){var h=new n.Matrix().rotate(new n.Number().morph(this.rotation-(this._undo?this._undo.rotation:0)).at(l),this.cx,this.cy);return this.inversed?h.inverse():h},undo:function(l){return this._undo=l,this}}}),n.Scale=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(l,h){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["scaleX","scaleY","cx","cy"],method:"scale"}}),n.Skew=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(l,h){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["skewX","skewY","cx","cy"],method:"skew"}}),n.extend(n.Element,{style:function(l,h){if(arguments.length==0)return this.node.style.cssText||"";if(arguments.length<2)if(typeof l=="object")for(h in l)this.style(h,l[h]);else{if(!n.regex.isCss.test(l))return this.node.style[p(l)];for(l=l.split(/\s*;\s*/).filter(function(y){return!!y}).map(function(y){return y.split(/\s*:\s*/)});h=l.pop();)this.style(h[0],h[1])}else this.node.style[p(l)]=h===null||n.regex.isBlank.test(h)?"":h;return this}}),n.Parent=n.invent({create:function(l){this.constructor.call(this,l)},inherit:n.Element,extend:{children:function(){return n.utils.map(n.utils.filterSVGElements(this.node.childNodes),function(l){return n.adopt(l)})},add:function(l,h){return h==null?this.node.appendChild(l.node):l.node!=this.node.childNodes[h]&&this.node.insertBefore(l.node,this.node.childNodes[h]),this},put:function(l,h){return this.add(l,h),l},has:function(l){return this.index(l)>=0},index:function(l){return[].slice.call(this.node.childNodes).indexOf(l.node)},get:function(l){return n.adopt(this.node.childNodes[l])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(l,h){var y,x,C=this.children();for(y=0,x=C.length;y<x;y++)C[y]instanceof n.Element&&l.apply(C[y],[y,C]),h&&C[y]instanceof n.Container&&C[y].each(l,h);return this},removeElement:function(l){return this.node.removeChild(l.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),n.extend(n.Parent,{ungroup:function(l,h){return h===0||this instanceof n.Defs||this.node==n.parser.draw||(l=l||(this instanceof n.Doc?this:this.parent(n.Parent)),h=h||1/0,this.each(function(){return this instanceof n.Defs?this:this instanceof n.Parent?this.ungroup(l,h-1):this.toParent(l)}),this.node.firstChild||this.remove()),this},flatten:function(l,h){return this.ungroup(l,h)}}),n.Container=n.invent({create:function(l){this.constructor.call(this,l)},inherit:n.Parent}),n.ViewBox=n.invent({create:function(l){var h,y,x,C,N,O,B,H=1,q=1,U=/[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/gi;if(l instanceof n.Element){for(O=l,B=l,N=(l.attr("viewBox")||"").match(U),l.bbox,x=new n.Number(l.width()),C=new n.Number(l.height());x.unit=="%";)H*=x.value,x=new n.Number(O instanceof n.Doc?O.parent().offsetWidth:O.parent().width()),O=O.parent();for(;C.unit=="%";)q*=C.value,C=new n.Number(B instanceof n.Doc?B.parent().offsetHeight:B.parent().height()),B=B.parent();this.x=0,this.y=0,this.width=x*H,this.height=C*q,this.zoom=1,N&&(h=parseFloat(N[0]),y=parseFloat(N[1]),x=parseFloat(N[2]),C=parseFloat(N[3]),this.zoom=this.width/this.height>x/C?this.height/C:this.width/x,this.x=h,this.y=y,this.width=x,this.height=C)}else l=typeof l=="string"?l.match(U).map(function(V){return parseFloat(V)}):Array.isArray(l)?l:typeof l=="object"?[l.x,l.y,l.width,l.height]:arguments.length==4?[].slice.call(arguments):[0,0,0,0],this.x=l[0],this.y=l[1],this.width=l[2],this.height=l[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(l,h,y,x){return this.destination=new n.ViewBox(l,h,y,x),this},at:function(l){return this.destination?new n.ViewBox([this.x+(this.destination.x-this.x)*l,this.y+(this.destination.y-this.y)*l,this.width+(this.destination.width-this.width)*l,this.height+(this.destination.height-this.height)*l]):this}},parent:n.Container,construct:{viewbox:function(l,h,y,x){return arguments.length==0?new n.ViewBox(this):this.attr("viewBox",new n.ViewBox(l,h,y,x))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(l){n.Element.prototype[l]=function(h){return h==null?n.off(this,l):n.on(this,l,h),this}}),n.listenerId=0,n.on=function(l,h,y,x,C){var N=y.bind(x||l),O=l instanceof n.Element?l.node:l;O.instance=O.instance||{_events:{}};var B=O.instance._events;y._svgjsListenerId||(y._svgjsListenerId=++n.listenerId),h.split(n.regex.delimiter).forEach(function(H){var q=H.split(".")[0],U=H.split(".")[1]||"*";B[q]=B[q]||{},B[q][U]=B[q][U]||{},B[q][U][y._svgjsListenerId]=N,O.addEventListener(q,N,C||!1)})},n.off=function(l,h,y,x){var C=l instanceof n.Element?l.node:l;if(C.instance&&(typeof y!="function"||(y=y._svgjsListenerId))){var N=C.instance._events;(h||"").split(n.regex.delimiter).forEach(function(O){var B,H,q=O&&O.split(".")[0],U=O&&O.split(".")[1];if(y)N[q]&&N[q][U||"*"]&&(C.removeEventListener(q,N[q][U||"*"][y],x||!1),delete N[q][U||"*"][y]);else if(q&&U){if(N[q]&&N[q][U]){for(H in N[q][U])n.off(C,[q,U].join("."),H);delete N[q][U]}}else if(U)for(O in N)for(B in N[O])U===B&&n.off(C,[O,U].join("."));else if(q){if(N[q]){for(B in N[q])n.off(C,[q,B].join("."));delete N[q]}}else{for(O in N)n.off(C,O);C.instance._events={}}})}},n.extend(n.Element,{on:function(l,h,y,x){return n.on(this,l,h,y,x),this},off:function(l,h){return n.off(this.node,l,h),this},fire:function(l,h){return l instanceof e.Event?this.node.dispatchEvent(l):this.node.dispatchEvent(l=new n.CustomEvent(l,{detail:h,cancelable:!0})),this._event=l,this},event:function(){return this._event}}),n.Defs=n.invent({create:"defs",inherit:n.Container}),n.G=n.invent({create:"g",inherit:n.Container,extend:{x:function(l){return l==null?this.transform("x"):this.transform({x:l-this.x()},!0)},y:function(l){return l==null?this.transform("y"):this.transform({y:l-this.y()},!0)},cx:function(l){return l==null?this.gbox().cx:this.x(l-this.gbox().width/2)},cy:function(l){return l==null?this.gbox().cy:this.y(l-this.gbox().height/2)},gbox:function(){var l=this.bbox(),h=this.transform();return l.x+=h.x,l.x2+=h.x,l.cx+=h.x,l.y+=h.y,l.y2+=h.y,l.cy+=h.y,l}},construct:{group:function(){return this.put(new n.G)}}}),n.Doc=n.invent({create:function(l){l&&((l=typeof l=="string"?t.getElementById(l):l).nodeName=="svg"?this.constructor.call(this,l):(this.constructor.call(this,n.create("svg")),l.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:n.Container,extend:{namespace:function(){return this.attr({xmlns:n.ns,version:"1.1"}).attr("xmlns:xlink",n.xlink,n.xmlns).attr("xmlns:svgjs",n.svgjs,n.xmlns)},defs:function(){var l;return this._defs||((l=this.node.getElementsByTagName("defs")[0])?this._defs=n.adopt(l):this._defs=new n.Defs,this.node.appendChild(this._defs.node)),this._defs},parent:function(){return this.node.parentNode&&this.node.parentNode.nodeName!="#document"&&this.node.parentNode.nodeName!="#document-fragment"?this.node.parentNode:null},spof:function(){var l=this.node.getScreenCTM();return l&&this.style("left",-l.e%1+"px").style("top",-l.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,n.parser.draw.parentNode||this.node.appendChild(n.parser.draw),this},clone:function(l){this.writeDataToDom();var h=this.node,y=_(h.cloneNode(!0));return l?(l.node||l).appendChild(y.node):h.parentNode.insertBefore(y.node,h.nextSibling),y}}}),n.extend(n.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var l=this.position()+1,h=this.parent();return h.removeElement(this).add(this,l),h instanceof n.Doc&&h.node.appendChild(h.defs().node),this},backward:function(){var l=this.position();return l>0&&this.parent().removeElement(this).add(this,l-1),this},front:function(){var l=this.parent();return l.node.appendChild(this.node),l instanceof n.Doc&&l.node.appendChild(l.defs().node),this},back:function(){return this.position()>0&&this.parent().removeElement(this).add(this,0),this},before:function(l){l.remove();var h=this.position();return this.parent().add(l,h),this},after:function(l){l.remove();var h=this.position();return this.parent().add(l,h+1),this}}),n.Mask=n.invent({create:function(){this.constructor.call(this,n.create("mask")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var l=this.targets.length-1;l>=0;l--)this.targets[l]&&this.targets[l].unmask();return this.targets=[],n.Element.prototype.remove.call(this),this}},construct:{mask:function(){return this.defs().put(new n.Mask)}}}),n.extend(n.Element,{maskWith:function(l){return this.masker=l instanceof n.Mask?l:this.parent().mask().add(l),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}}),n.ClipPath=n.invent({create:function(){this.constructor.call(this,n.create("clipPath")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var l=this.targets.length-1;l>=0;l--)this.targets[l]&&this.targets[l].unclip();return this.targets=[],this.parent().removeElement(this),this}},construct:{clip:function(){return this.defs().put(new n.ClipPath)}}}),n.extend(n.Element,{clipWith:function(l){return this.clipper=l instanceof n.ClipPath?l:this.parent().clip().add(l),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}}),n.Gradient=n.invent({create:function(l){this.constructor.call(this,n.create(l+"Gradient")),this.type=l},inherit:n.Container,extend:{at:function(l,h,y){return this.put(new n.Stop).update(l,h,y)},update:function(l){return this.clear(),typeof l=="function"&&l.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(l,h,y){return l=="transform"&&(l="gradientTransform"),n.Container.prototype.attr.call(this,l,h,y)}},construct:{gradient:function(l,h){return this.defs().gradient(l,h)}}}),n.extend(n.Gradient,n.FX,{from:function(l,h){return(this._target||this).type=="radial"?this.attr({fx:new n.Number(l),fy:new n.Number(h)}):this.attr({x1:new n.Number(l),y1:new n.Number(h)})},to:function(l,h){return(this._target||this).type=="radial"?this.attr({cx:new n.Number(l),cy:new n.Number(h)}):this.attr({x2:new n.Number(l),y2:new n.Number(h)})}}),n.extend(n.Defs,{gradient:function(l,h){return this.put(new n.Gradient(l)).update(h)}}),n.Stop=n.invent({create:"stop",inherit:n.Element,extend:{update:function(l){return(typeof l=="number"||l instanceof n.Number)&&(l={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),l.opacity!=null&&this.attr("stop-opacity",l.opacity),l.color!=null&&this.attr("stop-color",l.color),l.offset!=null&&this.attr("offset",new n.Number(l.offset)),this}}}),n.Pattern=n.invent({create:"pattern",inherit:n.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(l){return this.clear(),typeof l=="function"&&l.call(this,this),this},toString:function(){return this.fill()},attr:function(l,h,y){return l=="transform"&&(l="patternTransform"),n.Container.prototype.attr.call(this,l,h,y)}},construct:{pattern:function(l,h,y){return this.defs().pattern(l,h,y)}}}),n.extend(n.Defs,{pattern:function(l,h,y){return this.put(new n.Pattern).update(y).attr({x:0,y:0,width:l,height:h,patternUnits:"userSpaceOnUse"})}}),n.Shape=n.invent({create:function(l){this.constructor.call(this,l)},inherit:n.Element}),n.Bare=n.invent({create:function(l,h){if(this.constructor.call(this,n.create(l)),h)for(var y in h.prototype)typeof h.prototype[y]=="function"&&(this[y]=h.prototype[y])},inherit:n.Element,extend:{words:function(l){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(t.createTextNode(l)),this}}}),n.extend(n.Parent,{element:function(l,h){return this.put(new n.Bare(l,h))}}),n.Symbol=n.invent({create:"symbol",inherit:n.Container,construct:{symbol:function(){return this.put(new n.Symbol)}}}),n.Use=n.invent({create:"use",inherit:n.Shape,extend:{element:function(l,h){return this.attr("href",(h||"")+"#"+l,n.xlink)}},construct:{use:function(l,h){return this.put(new n.Use).element(l,h)}}}),n.Rect=n.invent({create:"rect",inherit:n.Shape,construct:{rect:function(l,h){return this.put(new n.Rect).size(l,h)}}}),n.Circle=n.invent({create:"circle",inherit:n.Shape,construct:{circle:function(l){return this.put(new n.Circle).rx(new n.Number(l).divide(2)).move(0,0)}}}),n.extend(n.Circle,n.FX,{rx:function(l){return this.attr("r",l)},ry:function(l){return this.rx(l)}}),n.Ellipse=n.invent({create:"ellipse",inherit:n.Shape,construct:{ellipse:function(l,h){return this.put(new n.Ellipse).size(l,h).move(0,0)}}}),n.extend(n.Ellipse,n.Rect,n.FX,{rx:function(l){return this.attr("rx",l)},ry:function(l){return this.attr("ry",l)}}),n.extend(n.Circle,n.Ellipse,{x:function(l){return l==null?this.cx()-this.rx():this.cx(l+this.rx())},y:function(l){return l==null?this.cy()-this.ry():this.cy(l+this.ry())},cx:function(l){return l==null?this.attr("cx"):this.attr("cx",l)},cy:function(l){return l==null?this.attr("cy"):this.attr("cy",l)},width:function(l){return l==null?2*this.rx():this.rx(new n.Number(l).divide(2))},height:function(l){return l==null?2*this.ry():this.ry(new n.Number(l).divide(2))},size:function(l,h){var y=f(this,l,h);return this.rx(new n.Number(y.width).divide(2)).ry(new n.Number(y.height).divide(2))}}),n.Line=n.invent({create:"line",inherit:n.Shape,extend:{array:function(){return new n.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(l,h,y,x){return l==null?this.array():(l=h!==void 0?{x1:l,y1:h,x2:y,y2:x}:new n.PointArray(l).toLine(),this.attr(l))},move:function(l,h){return this.attr(this.array().move(l,h).toLine())},size:function(l,h){var y=f(this,l,h);return this.attr(this.array().size(y.width,y.height).toLine())}},construct:{line:function(l,h,y,x){return n.Line.prototype.plot.apply(this.put(new n.Line),l!=null?[l,h,y,x]:[0,0,0,0])}}}),n.Polyline=n.invent({create:"polyline",inherit:n.Shape,construct:{polyline:function(l){return this.put(new n.Polyline).plot(l||new n.PointArray)}}}),n.Polygon=n.invent({create:"polygon",inherit:n.Shape,construct:{polygon:function(l){return this.put(new n.Polygon).plot(l||new n.PointArray)}}}),n.extend(n.Polyline,n.Polygon,{array:function(){return this._array||(this._array=new n.PointArray(this.attr("points")))},plot:function(l){return l==null?this.array():this.clear().attr("points",typeof l=="string"?l:this._array=new n.PointArray(l))},clear:function(){return delete this._array,this},move:function(l,h){return this.attr("points",this.array().move(l,h))},size:function(l,h){var y=f(this,l,h);return this.attr("points",this.array().size(y.width,y.height))}}),n.extend(n.Line,n.Polyline,n.Polygon,{morphArray:n.PointArray,x:function(l){return l==null?this.bbox().x:this.move(l,this.bbox().y)},y:function(l){return l==null?this.bbox().y:this.move(this.bbox().x,l)},width:function(l){var h=this.bbox();return l==null?h.width:this.size(l,h.height)},height:function(l){var h=this.bbox();return l==null?h.height:this.size(h.width,l)}}),n.Path=n.invent({create:"path",inherit:n.Shape,extend:{morphArray:n.PathArray,array:function(){return this._array||(this._array=new n.PathArray(this.attr("d")))},plot:function(l){return l==null?this.array():this.clear().attr("d",typeof l=="string"?l:this._array=new n.PathArray(l))},clear:function(){return delete this._array,this},move:function(l,h){return this.attr("d",this.array().move(l,h))},x:function(l){return l==null?this.bbox().x:this.move(l,this.bbox().y)},y:function(l){return l==null?this.bbox().y:this.move(this.bbox().x,l)},size:function(l,h){var y=f(this,l,h);return this.attr("d",this.array().size(y.width,y.height))},width:function(l){return l==null?this.bbox().width:this.size(l,this.bbox().height)},height:function(l){return l==null?this.bbox().height:this.size(this.bbox().width,l)}},construct:{path:function(l){return this.put(new n.Path).plot(l||new n.PathArray)}}}),n.Image=n.invent({create:"image",inherit:n.Shape,extend:{load:function(l){if(!l)return this;var h=this,y=new e.Image;return n.on(y,"load",function(){n.off(y);var x=h.parent(n.Pattern);x!==null&&(h.width()==0&&h.height()==0&&h.size(y.width,y.height),x&&x.width()==0&&x.height()==0&&x.size(h.width(),h.height()),typeof h._loaded=="function"&&h._loaded.call(h,{width:y.width,height:y.height,ratio:y.width/y.height,url:l}))}),n.on(y,"error",function(x){n.off(y),typeof h._error=="function"&&h._error.call(h,x)}),this.attr("href",y.src=this.src=l,n.xlink)},loaded:function(l){return this._loaded=l,this},error:function(l){return this._error=l,this}},construct:{image:function(l,h,y){return this.put(new n.Image).load(l).size(h||0,y||h||0)}}}),n.Text=n.invent({create:function(){this.constructor.call(this,n.create("text")),this.dom.leading=new n.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",n.defaults.attrs["font-family"])},inherit:n.Shape,extend:{x:function(l){return l==null?this.attr("x"):this.attr("x",l)},y:function(l){var h=this.attr("y"),y=typeof h=="number"?h-this.bbox().y:0;return l==null?typeof h=="number"?h-y:h:this.attr("y",typeof l.valueOf()=="number"?l+y:l)},cx:function(l){return l==null?this.bbox().cx:this.x(l-this.bbox().width/2)},cy:function(l){return l==null?this.bbox().cy:this.y(l-this.bbox().height/2)},text:function(l){if(l===void 0){l="";for(var h=this.node.childNodes,y=0,x=h.length;y<x;++y)y!=0&&h[y].nodeType!=3&&n.adopt(h[y]).dom.newLined==1&&(l+=`
  232. `),l+=h[y].textContent;return l}if(this.clear().build(!0),typeof l=="function")l.call(this,this);else{y=0;for(var C=(l=l.split(`
  233. `)).length;y<C;y++)this.tspan(l[y]).newLine()}return this.build(!1).rebuild()},size:function(l){return this.attr("font-size",l).rebuild()},leading:function(l){return l==null?this.dom.leading:(this.dom.leading=new n.Number(l),this.rebuild())},lines:function(){var l=(this.textPath&&this.textPath()||this).node,h=n.utils.map(n.utils.filterSVGElements(l.childNodes),function(y){return n.adopt(y)});return new n.Set(h)},rebuild:function(l){if(typeof l=="boolean"&&(this._rebuild=l),this._rebuild){var h=this,y=0,x=this.dom.leading*new n.Number(this.attr("font-size"));this.lines().each(function(){this.dom.newLined&&(h.textPath()||this.attr("x",h.attr("x")),this.text()==`
  234. `?y+=x:(this.attr("dy",x+y),y=0))}),this.fire("rebuild")}return this},build:function(l){return this._build=!!l,this},setData:function(l){return this.dom=l,this.dom.leading=new n.Number(l.leading||1.3),this}},construct:{text:function(l){return this.put(new n.Text).text(l)},plain:function(l){return this.put(new n.Text).plain(l)}}}),n.Tspan=n.invent({create:"tspan",inherit:n.Shape,extend:{text:function(l){return l==null?this.node.textContent+(this.dom.newLined?`
  235. `:""):(typeof l=="function"?l.call(this,this):this.plain(l),this)},dx:function(l){return this.attr("dx",l)},dy:function(l){return this.attr("dy",l)},newLine:function(){var l=this.parent(n.Text);return this.dom.newLined=!0,this.dy(l.dom.leading*l.attr("font-size")).attr("x",l.x())}}}),n.extend(n.Text,n.Tspan,{plain:function(l){return this._build===!1&&this.clear(),this.node.appendChild(t.createTextNode(l)),this},tspan:function(l){var h=(this.textPath&&this.textPath()||this).node,y=new n.Tspan;return this._build===!1&&this.clear(),h.appendChild(y.node),y.text(l)},clear:function(){for(var l=(this.textPath&&this.textPath()||this).node;l.hasChildNodes();)l.removeChild(l.lastChild);return this},length:function(){return this.node.getComputedTextLength()}}),n.TextPath=n.invent({create:"textPath",inherit:n.Parent,parent:n.Text,construct:{morphArray:n.PathArray,path:function(l){for(var h=new n.TextPath,y=this.doc().defs().path(l);this.node.hasChildNodes();)h.node.appendChild(this.node.firstChild);return this.node.appendChild(h.node),h.attr("href","#"+y,n.xlink),this},array:function(){var l=this.track();return l?l.array():null},plot:function(l){var h=this.track(),y=null;return h&&(y=h.plot(l)),l==null?y:this},track:function(){var l=this.textPath();if(l)return l.reference("href")},textPath:function(){if(this.node.firstChild&&this.node.firstChild.nodeName=="textPath")return n.adopt(this.node.firstChild)}}}),n.Nested=n.invent({create:function(){this.constructor.call(this,n.create("svg")),this.style("overflow","visible")},inherit:n.Container,construct:{nested:function(){return this.put(new n.Nested)}}}),n.A=n.invent({create:"a",inherit:n.Container,extend:{to:function(l){return this.attr("href",l,n.xlink)},show:function(l){return this.attr("show",l,n.xlink)},target:function(l){return this.attr("target",l)}},construct:{link:function(l){return this.put(new n.A).to(l)}}}),n.extend(n.Element,{linkTo:function(l){var h=new n.A;return typeof l=="function"?l.call(h,h):h.to(l),this.parent().put(h).put(this)}}),n.Marker=n.invent({create:"marker",inherit:n.Container,extend:{width:function(l){return this.attr("markerWidth",l)},height:function(l){return this.attr("markerHeight",l)},ref:function(l,h){return this.attr("refX",l).attr("refY",h)},update:function(l){return this.clear(),typeof l=="function"&&l.call(this,this),this},toString:function(){return"url(#"+this.id()+")"}},construct:{marker:function(l,h,y){return this.defs().marker(l,h,y)}}}),n.extend(n.Defs,{marker:function(l,h,y){return this.put(new n.Marker).size(l,h).ref(l/2,h/2).viewbox(0,0,l,h).attr("orient","auto").update(y)}}),n.extend(n.Line,n.Polyline,n.Polygon,n.Path,{marker:function(l,h,y,x){var C=["marker"];return l!="all"&&C.push(l),C=C.join("-"),l=arguments[1]instanceof n.Marker?arguments[1]:this.doc().marker(h,y,x),this.attr(C,l)}});var s={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(l,h){return h=="color"?l:l+"-"+h}};function c(l,h,y,x){return y+x.replace(n.regex.dots," .")}function u(l){for(var h=l.slice(0),y=h.length;y--;)Array.isArray(h[y])&&(h[y]=u(h[y]));return h}function p(l){return l.toLowerCase().replace(/-(.)/g,function(h,y){return y.toUpperCase()})}function d(l){return l.charAt(0).toUpperCase()+l.slice(1)}function m(l){var h=l.toString(16);return h.length==1?"0"+h:h}function f(l,h,y){if(h==null||y==null){var x=l.bbox();h==null?h=x.width/x.height*y:y==null&&(y=x.height/x.width*h)}return{width:h,height:y}}function v(l,h,y){return{x:h*l.a+y*l.c+0,y:h*l.b+y*l.d+0}}function g(l){return{a:l[0],b:l[1],c:l[2],d:l[3],e:l[4],f:l[5]}}function E(l,h){l.cx=l.cx==null?h.bbox().cx:l.cx,l.cy=l.cy==null?h.bbox().cy:l.cy}function _(l){for(var h=l.childNodes.length-1;h>=0;h--)l.childNodes[h]instanceof e.SVGElement&&_(l.childNodes[h]);return n.adopt(l).id(n.eid(l.nodeName))}function b(l){return l.x==null&&(l.x=0,l.y=0,l.width=0,l.height=0),l.w=l.width,l.h=l.height,l.x2=l.x+l.width,l.y2=l.y+l.height,l.cx=l.x+l.width/2,l.cy=l.y+l.height/2,l}function w(l){return Math.abs(l)>1e-37?l:0}["fill","stroke"].forEach(function(l){var h,y={};y[l]=function(x){if(x===void 0)return this;if(typeof x=="string"||n.Color.isRgb(x)||x&&typeof x.fill=="function")this.attr(l,x);else for(h=s[l].length-1;h>=0;h--)x[s[l][h]]!=null&&this.attr(s.prefix(l,s[l][h]),x[s[l][h]]);return this},n.extend(n.Element,n.FX,y)}),n.extend(n.Element,n.FX,{rotate:function(l,h,y){return this.transform({rotation:l,cx:h,cy:y})},skew:function(l,h,y,x){return arguments.length==1||arguments.length==3?this.transform({skew:l,cx:h,cy:y}):this.transform({skewX:l,skewY:h,cx:y,cy:x})},scale:function(l,h,y,x){return arguments.length==1||arguments.length==3?this.transform({scale:l,cx:h,cy:y}):this.transform({scaleX:l,scaleY:h,cx:y,cy:x})},translate:function(l,h){return this.transform({x:l,y:h})},flip:function(l,h){return h=typeof l=="number"?l:h,this.transform({flip:l||"both",offset:h})},matrix:function(l){return this.attr("transform",new n.Matrix(arguments.length==6?[].slice.call(arguments):l))},opacity:function(l){return this.attr("opacity",l)},dx:function(l){return this.x(new n.Number(l).plus(this instanceof n.FX?0:this.x()),!0)},dy:function(l){return this.y(new n.Number(l).plus(this instanceof n.FX?0:this.y()),!0)},dmove:function(l,h){return this.dx(l).dy(h)}}),n.extend(n.Rect,n.Ellipse,n.Circle,n.Gradient,n.FX,{radius:function(l,h){var y=(this._target||this).type;return y=="radial"||y=="circle"?this.attr("r",new n.Number(l)):this.rx(l).ry(h??l)}}),n.extend(n.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(l){return this.node.getPointAtLength(l)}}),n.extend(n.Parent,n.Text,n.Tspan,n.FX,{font:function(l,h){if(typeof l=="object")for(h in l)this.font(h,l[h]);return l=="leading"?this.leading(h):l=="anchor"?this.attr("text-anchor",h):l=="size"||l=="family"||l=="weight"||l=="stretch"||l=="variant"||l=="style"?this.attr("font-"+l,h):this.attr(l,h)}}),n.Set=n.invent({create:function(l){l instanceof n.Set?this.members=l.members.slice():Array.isArray(l)?this.members=l:this.clear()},extend:{add:function(){var l,h,y=[].slice.call(arguments);for(l=0,h=y.length;l<h;l++)this.members.push(y[l]);return this},remove:function(l){var h=this.index(l);return h>-1&&this.members.splice(h,1),this},each:function(l){for(var h=0,y=this.members.length;h<y;h++)l.apply(this.members[h],[h,this.members]);return this},clear:function(){return this.members=[],this},length:function(){return this.members.length},has:function(l){return this.index(l)>=0},index:function(l){return this.members.indexOf(l)},get:function(l){return this.members[l]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members},bbox:function(){if(this.members.length==0)return new n.RBox;var l=this.members[0].rbox(this.members[0].doc());return this.each(function(){l=l.merge(this.rbox(this.doc()))}),l}},construct:{set:function(l){return new n.Set(l)}}}),n.FX.Set=n.invent({create:function(l){this.set=l}}),n.Set.inherit=function(){var l=[];for(var h in n.Shape.prototype)typeof n.Shape.prototype[h]=="function"&&typeof n.Set.prototype[h]!="function"&&l.push(h);for(var h in l.forEach(function(x){n.Set.prototype[x]=function(){for(var C=0,N=this.members.length;C<N;C++)this.members[C]&&typeof this.members[C][x]=="function"&&this.members[C][x].apply(this.members[C],arguments);return x=="animate"?this.fx||(this.fx=new n.FX.Set(this)):this}}),l=[],n.FX.prototype)typeof n.FX.prototype[h]=="function"&&typeof n.FX.Set.prototype[h]!="function"&&l.push(h);l.forEach(function(y){n.FX.Set.prototype[y]=function(){for(var x=0,C=this.set.members.length;x<C;x++)this.set.members[x].fx[y].apply(this.set.members[x].fx,arguments);return this}})},n.extend(n.Element,{data:function(l,h,y){if(typeof l=="object")for(h in l)this.data(h,l[h]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+l))}catch{return this.attr("data-"+l)}else this.attr("data-"+l,h===null?null:y===!0||typeof h=="string"||typeof h=="number"?h:JSON.stringify(h));return this}}),n.extend(n.Element,{remember:function(l,h){if(typeof arguments[0]=="object")for(var h in l)this.remember(h,l[h]);else{if(arguments.length==1)return this.memory()[l];this.memory()[l]=h}return this},forget:function(){if(arguments.length==0)this._memory={};else for(var l=arguments.length-1;l>=0;l--)delete this.memory()[arguments[l]];return this},memory:function(){return this._memory||(this._memory={})}}),n.get=function(l){var h=t.getElementById(function(y){var x=(y||"").toString().match(n.regex.reference);if(x)return x[1]}(l)||l);return n.adopt(h)},n.select=function(l,h){return new n.Set(n.utils.map((h||t).querySelectorAll(l),function(y){return n.adopt(y)}))},n.extend(n.Parent,{select:function(l){return n.select(l,this.node)}});var S="abcdef".split("");if(typeof e.CustomEvent!="function"){var k=function(l,h){h=h||{bubbles:!1,cancelable:!1,detail:void 0};var y=t.createEvent("CustomEvent");return y.initCustomEvent(l,h.bubbles,h.cancelable,h.detail),y};k.prototype=e.Event.prototype,n.CustomEvent=k}else n.CustomEvent=e.CustomEvent;return function(l){for(var h=0,y=["moz","webkit"],x=0;x<y.length&&!e.requestAnimationFrame;++x)l.requestAnimationFrame=l[y[x]+"RequestAnimationFrame"],l.cancelAnimationFrame=l[y[x]+"CancelAnimationFrame"]||l[y[x]+"CancelRequestAnimationFrame"];l.requestAnimationFrame=l.requestAnimationFrame||function(C){var N=new Date().getTime(),O=Math.max(0,16-(N-h)),B=l.setTimeout(function(){C(N+O)},O);return h=N+O,B},l.cancelAnimationFrame=l.cancelAnimationFrame||l.clearTimeout}(e),n},ob.exports=Yl.document?Id(Yl,Yl.document):function(e){return Id(e,e.document)};var dS=ob.exports,Bd={exports:{}};(function(e,t){function n(i,r){return r.querySelector(i)}(t=Bd.exports=function(i,r){return n(i,r=r||document)}).all=function(i,r){return(r=r||document).querySelectorAll(i)},t.engine=function(i){if(!i.one)throw new Error(".one callback required");if(!i.all)throw new Error(".all callback required");return n=i.one,t.all=i.all,t}})(0,Bd.exports);var Va=Bd.exports,Yt="tokenSimulation",ee={TOGGLE_MODE_EVENT:Yt+".toggleMode",GENERATE_TOKEN_EVENT:Yt+".generateToken",CONSUME_TOKEN_EVENT:Yt+".consumeToken",PLAY_SIMULATION_EVENT:Yt+".playSimulation",PAUSE_SIMULATION_EVENT:Yt+".pauseSimulation",RESET_SIMULATION_EVENT:Yt+".resetSimulation",TERMINATE_EVENT:Yt+".terminateEvent",UPDATE_ELEMENTS_EVENT:Yt+".updateElements",UPDATE_ELEMENT_EVENT:Yt+".updateElement",PROCESS_INSTANCE_CREATED_EVENT:Yt+".processInstanceCreated",PROCESS_INSTANCE_FINISHED_EVENT:Yt+".processInstanceFinished",PROCESS_INSTANCE_SHOWN_EVENT:Yt+".processInstanceShown",PROCESS_INSTANCE_HIDDEN_EVENT:Yt+".processInstanceHidden",ANIMATION_CREATED_EVENT:Yt+".animationCreated"},Ge={},$a=Object.prototype.toString,hS=Object.prototype.hasOwnProperty;function wo(e){return e===void 0}function ab(e){return e!==void 0}function Dd(e){return e==null}function Jl(e){return $a.call(e)==="[object Array]"}function Zl(e){return $a.call(e)==="[object Object]"}function Od(e){var t=$a.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function sb(e){if(!Jl(e))throw new Error("must supply array")}function lb(e,t){return hS.call(e,t)}function cb(e,t){var n;return t=jd(t),Ft(e,function(i,r){if(t(i,r))return n=i,!1}),n}function Ft(e,t){var n;if(!wo(e)){var i=Jl(e)?vS:fS;for(var r in e)if(lb(e,r)&&t(n=e[r],i(r))===!1)return n}}function ub(e,t,n){return Ft(e,function(i,r){n=t(n,i,r)}),n}function pb(e,t){return!!ub(e,function(n,i,r){return n&&t(i,r)},!0)}function Ql(e,t){var n=[];return Ft(e,function(i,r){n.push(t(i,r))}),n}function db(e){return e&&Object.keys(e)||[]}function hb(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=Ld(t),Ft(e,function(i){var r=t(i)||"_",o=n[r];o||(o=n[r]=[]),o.push(i)}),n}function mb(e){e=Ld(e);for(var t={},n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Ft(i,function(o){return hb(o,e,t)}),Ql(t,function(o,a){return o[0]})}var mS=mb;function Ld(e){return Od(e)?e:function(t){return t[e]}}function jd(e){return Od(e)?e:function(t){return t===e}}function fS(e){return e}function vS(e){return Number(e)}function Vd(e){return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vd(e)}function $d(){return $d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},$d.apply(this,arguments)}const yS=Object.freeze(Object.defineProperty({__proto__:null,assign:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return $d.apply(void 0,[e].concat(n))},bind:function(e,t){return e.bind(t)},debounce:function(e,t){var n,i,r,o;function a(p){var d=Date.now(),m=p?0:o+t-d;if(m>0)return s(m);e.apply(r,i),c()}function s(p){n=setTimeout(a,p)}function c(){n&&clearTimeout(n),n=o=i=r=void 0}function u(){o=Date.now();for(var p=arguments.length,d=new Array(p),m=0;m<p;m++)d[m]=arguments[m];i=d,r=this,n||s(t)}return u.flush=function(){n&&a(!0),c()},u.cancel=c,u},ensureArray:sb,every:pb,filter:function(e,t){var n=[];return Ft(e,function(i,r){t(i,r)&&n.push(i)}),n},find:cb,findIndex:function(e,t){t=jd(t);var n=Jl(e)?-1:void 0;return Ft(e,function(i,r){if(t(i,r))return n=r,!1}),n},flatten:function(e){return Array.prototype.concat.apply([],e)},forEach:Ft,get:function(e,t,n){var i=e;return Ft(t,function(r){if(Dd(i))return i=void 0,!1;i=i[r]}),wo(i)?n:i},groupBy:hb,has:lb,isArray:Jl,isDefined:ab,isFunction:Od,isNil:Dd,isNumber:function(e){return $a.call(e)==="[object Number]"},isObject:Zl,isString:function(e){return $a.call(e)==="[object String]"},isUndefined:wo,keys:db,map:Ql,matchPattern:function(e){return function(t){return pb(e,function(n,i){return t[i]===n})}},merge:function e(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return i.length&&Ft(i,function(o){o&&Zl(o)&&Ft(o,function(a,s){if(s!=="__proto__"){var c=t[s];Zl(a)?(Zl(c)||(c={}),t[s]=e(c,a)):t[s]=a}})}),t},omit:function(e,t){var n={};return Ft(Object(e),function(i,r){t.indexOf(r)===-1&&(n[r]=i)}),n},pick:function(e,t){var n={},i=Object(e);return Ft(t,function(r){r in i&&(n[r]=e[r])}),n},reduce:ub,set:function(e,t,n){var i=e;return Ft(t,function(r,o){if(typeof r!="number"&&typeof r!="string")throw new Error("illegal key type: "+Vd(r)+". Key should be of type number or string.");if(r==="constructor")throw new Error("illegal key: constructor");if(r==="__proto__")throw new Error("illegal key: __proto__");var a=t[o+1],s=i[r];ab(a)&&Dd(s)&&(s=i[r]=isNaN(+a)?{}:[]),wo(a)?wo(n)?delete i[r]:i[r]=n:i=s}),e},size:function(e){return db(e).length},some:function(e,t){return!!cb(e,t)},sortBy:function(e,t){t=Ld(t);var n=[];return Ft(e,function(i,r){for(var o=t(i,r),a={d:o,v:i},s=0;s<n.length;s++)if(o<n[s].d)return void n.splice(s,0,a);n.push(a)}),Ql(n,function(i){return i.v})},throttle:function(e,t){var n=!1;return function(){n||(e.apply(void 0,arguments),n=!0,setTimeout(function(){n=!1},t))}},unionBy:mS,uniqueBy:mb,values:function(e){return Ql(e,function(t){return t})},without:function(e,t){return wo(e)?[]:(sb(e),t=jd(t),e.filter(function(n,i){return!t(n,i)}))}},Symbol.toStringTag,{value:"Module"})),fb=Px(yS);var gS=fb.every,bS=fb.some;function vb(e,t){for(var n=t.parent;n;){if(n===e)return!0;n=n.parent}return!1}Ge.is=function(e,t){if(e.type!=="label"){Array.isArray(t)||(t=[t]);var n=!1;return t.forEach(function(i){i===e.type&&(n=!0)}),n}},Ge.isTypedEvent=function(e,t,n){return bS(e.eventDefinitions,function(i){return i.$type===t&&function(r,o){return gS(o,function(a,s){return r[s]==a})}(e,n)})},Ge.getBusinessObject=function(e){return e&&e.businessObject||e},Ge.isAncestor=vb,Ge.getDescendants=function(e,t){return e.filter(function(n){return vb(t,n)})},Ge.supportedElements=["bpmn:Association","bpmn:BoundaryEvent","bpmn:BusinessRuleTask","bpmn:CallActivity","bpmn:DataInputAssociation","bpmn:DataObjectReference","bpmn:DataOutputAssociation","bpmn:DataStoreReference","bpmn:EndEvent","bpmn:EventBasedGateway","bpmn:ExclusiveGateway","bpmn:IntermediateCatchEvent","bpmn:ManualTask","bpmn:ParallelGateway","bpmn:Process","bpmn:ScriptTask","bpmn:SequenceFlow","bpmn:ServiceTask","bpmn:StartEvent","bpmn:SubProcess","bpmn:Task","bpmn:TextAnnotation","bpmn:UserTask"];var xS=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},yb=dS,_S=Va,ES=ee.RESET_SIMULATION_EVENT,wS=ee.PLAY_SIMULATION_EVENT,SS=ee.PAUSE_SIMULATION_EVENT,CS=ee.TERMINATE_EVENT,kS=ee.PROCESS_INSTANCE_FINISHED_EVENT,AS=ee.ANIMATION_CREATED_EVENT,gb=Ge.isAncestor,TS=xS,PS=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-green-base-44");function Pr(e,t){var n=window.animation=this;this._eventBus=t,this.animations=[],this.hiddenAnimations=[],this.animationSpeed=1,t.on("import.done",function(){var i=yb(e._svg),r=_S(".viewport",e._svg),o=yb.adopt(r);n.group=i.group().attr("id","token-simulation"),o.put(n.group)}),t.on(CS,function(i){var r=i.element.parent;n.animations.forEach(function(o){gb(r,o.element)&&(o.animation.stop(),n.animations=n.animations.filter(function(a){return a!==o}))})}),t.on(kS,function(i){var r=i.parent;n.animations.forEach(function(o){(i.processInstanceId===o.processInstanceId||gb(r,o.element))&&(o.animation.stop(),n.animations=n.animations.filter(function(a){return a!==o}))})}),t.on(ES,function(){n.animations.forEach(function(i){i.animation.stop()}),n.animations=[],n.hiddenAnimations=[]}),t.on(SS,function(){n.animations.forEach(function(i){i.animation.pause()})}),t.on(wS,function(){n.animations.forEach(function(i){i.animation.play()})})}Pr.prototype.createAnimation=function(e,t,n){var i=this;if(this.group){var r,o=this._createTokenGfx(t);return r=new Fa(o,e.waypoints,function(){i.animations=i.animations.filter(function(a){return a.animation!==r}),n&&n()}),this.hiddenAnimations.includes(t)&&o.hide(),o.fx._speed=this.animationSpeed,this.animations.push({tokenGfx:o,animation:r,element:e,processInstanceId:t}),this._eventBus.fire(AS,{tokenGfx:o,animation:r,element:e,processInstanceId:t}),r}},Pr.prototype.setAnimationSpeed=function(e){this.animations.forEach(function(t){t.tokenGfx.fx._speed=e}),this.animationSpeed=e},Pr.prototype._createTokenGfx=function(e){var t=this.group.group().attr("class","token").hide();return t.circle(20,20).attr("fill",PS).attr("class","circle"),t.text(e.toString()).attr("transform","translate(10, -7)").attr("text-anchor","middle").attr("class","text"),t},Pr.prototype.showProcessInstanceAnimations=function(e){this.animations.forEach(function(t){t.processInstanceId===e&&t.tokenGfx.show()}),this.hiddenAnimations=this.hiddenAnimations.filter(function(t){return t!==e})},Pr.prototype.hideProcessInstanceAnimations=function(e){this.animations.forEach(function(t){t.processInstanceId===e&&t.tokenGfx.hide()}),this.hiddenAnimations.push(e)},Pr.$inject=["canvas","eventBus"];var RS=Pr;function Fa(e,t,n){this.gfx=this.fx=e,this.waypoints=t,this.done=n,this.create()}Fa.prototype.create=function(){var e=this.gfx,t=this.waypoints,n=this.done,i=this.fx;e.show().move(t[0].x-10,t[0].y-10),t.forEach(function(r,o){if(o>0){var a=r.x-10,s=r.y-10,c=function(p){return p===1}(o)?"<":"-";(function(p){return p.length==2})(t)&&(c="<>");var u=20*TS(t[o-1],r);i=i.animate(u,c,0).move(a,s)}}),i.after(function(){e.remove(),n()})},Fa.prototype.play=function(){this.gfx.play()},Fa.prototype.pause=function(){this.gfx.pause()},Fa.prototype.stop=function(){this.fx.stop(),this.gfx.remove()};var Fd,bb=!1;typeof document<"u"&&((Fd=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',bb=!Fd.getElementsByTagName("link").length,Fd=void 0);var ft={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:bb?[1,"X<div>","</div>"]:[0,"",""]};ft.td=ft.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],ft.option=ft.optgroup=[1,'<select multiple="multiple">',"</select>"],ft.thead=ft.tbody=ft.colgroup=ft.caption=ft.tfoot=[1,"<table>","</table>"],ft.polyline=ft.ellipse=ft.polygon=ft.circle=ft.text=ft.line=ft.path=ft.rect=ft.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var zt=function(e,t){if(typeof e!="string")throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if(i=="body")return(r=t.createElement("html")).innerHTML=e,r.removeChild(r.lastChild);var r,o=Object.prototype.hasOwnProperty.call(ft,i)?ft[i]:ft._default,a=o[0],s=o[1],c=o[2];for((r=t.createElement("div")).innerHTML=s+e+c;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var u=t.createDocumentFragment();r.firstChild;)u.appendChild(r.removeChild(r.firstChild));return u},zd={},xb=window.addEventListener?"addEventListener":"attachEvent",MS=window.removeEventListener?"removeEventListener":"detachEvent",_b=xb!=="addEventListener"?"on":"";zd.bind=function(e,t,n,i){return e[xb](_b+t,n,i||!1),n},zd.unbind=function(e,t,n,i){return e[MS](_b+t,n,i||!1),n};var In=zd,NS=zt,IS=In,Eb=Ge.is,BS=ee.GENERATE_TOKEN_EVENT,DS=ee.UPDATE_ELEMENT_EVENT;function Ud(e,t,n){this._eventBus=e,this._processInstances=t,this._processInstanceSettings=n}Ud.prototype.createContextPads=function(e){if(e.attachers.length&&this._processInstances.getProcessInstances(e).length){var t=e.incoming.filter(function(r){return Eb(r,"bpmn:SequenceFlow")}),n=this,i=[];return e.attachers.forEach(function(r){var o=r.outgoing.filter(function(s){return Eb(s,"bpmn:SequenceFlow")});if(t.length&&o.length){var a=NS('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>');i.push({element:r,html:a}),IS.bind(a,"click",function(){n._processInstances.getProcessInstances(e).forEach(function(s){var c=s.parentProcessInstanceId;r.businessObject.cancelActivity&&(e.children.forEach(function(u){u.tokenCount&&u.tokenCount[s.processInstanceId]&&u.tokenCount[s.processInstanceId]--}),n._processInstances.finish(s.processInstanceId),n._eventBus.fire(DS,{element:e})),n._eventBus.fire(BS,{element:r,processInstanceId:c})})})}}),i}},Ud.$inject=["eventBus","processInstances","processInstanceSettings"];var OS=Ud,LS=Ge.is,jS=zt,VS=In;function Hd(e){this._exclusiveGatewaySettings=e}Hd.prototype.createContextPads=function(e){var t=this;if(!(e.outgoing.filter(function(i){return LS(i,"bpmn:SequenceFlow")}).length<2)){var n=jS('<div class="context-pad" title="Set Sequence Flow"><i class="fa fa-code-fork"></i></div>');return VS.bind(n,"click",function(){t._exclusiveGatewaySettings.setSequenceFlow(e)}),[{element:e,html:n}]}},Hd.$inject=["exclusiveGatewaySettings"];var $S=Hd,wb=zt,Sb=In,Gd=Ge.is,Cb=ee.GENERATE_TOKEN_EVENT;function Wd(e){this._eventBus=e}Wd.prototype.createContextPads=function(e){var t=e.parent.shownProcessInstance,n=e.incoming.filter(function(s){return Gd(s,"bpmn:SequenceFlow")}),i=[];n.forEach(function(s){var c=s.source;Gd(c,"bpmn:EventBasedGateway")&&c.tokenCount&&c.tokenCount[t]&&i.push(c)});var r=e.outgoing.filter(function(s){return Gd(s,"bpmn:SequenceFlow")});if(n.length&&r.length){var o,a=this;if(e.tokenCount&&e.tokenCount[t])o=wb('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),Sb.bind(o,"click",function(){e.tokenCount[t]--,a._eventBus.fire(Cb,{element:e,processInstanceId:t})});else{if(!i.length)return;o=wb('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),Sb.bind(o,"click",function(){i.forEach(function(s){s.tokenCount[t]--}),a._eventBus.fire(Cb,{element:e,processInstanceId:t})})}return[{element:e,html:o}]}},Wd.$inject=["eventBus"];var FS=Wd,zS=zt,US=In;function qd(e,t){this._processInstances=e,this._processInstanceSettings=t}qd.prototype.createContextPads=function(e){var t=this;if(!(this._processInstances.getProcessInstances(e).filter(function(i){return!i.isFinished}).length<2)){var n=zS('<div class="context-pad" title="View Process Instances"><i class="fa fa-list-ol"></i></div>');return US.bind(n,"click",function(){t._processInstanceSettings.showNext(e)}),[{element:e,html:n}]}},qd.$inject=["processInstances","processInstanceSettings"];var HS=qd,GS=zt,WS=In,qS=Ge.is,KS=ee.GENERATE_TOKEN_EVENT;function Kd(e,t,n){this._eventBus=e,this._elementRegistry=t,this._animation=n}Kd.prototype.createContextPads=function(e){var t=!1;if(this._elementRegistry.forEach(function(r){r.tokenCount&&Object.values(r.tokenCount).forEach(function(o){o&&(t=!0)})}),!(qS(e.parent,"bpmn:SubProcess")||t||this._animation.animations.length)){var n=this,i=GS('<div class="context-pad"><i class="fa fa-play"></i></div>');return WS.bind(i,"click",function(){n._eventBus.fire(KS,{element:e})}),[{element:e,html:i}]}},Kd.$inject=["eventBus","elementRegistry","animation"];var XS=Kd,kb=Ge.isAncestor,YS=ee.TOGGLE_MODE_EVENT,JS=ee.RESET_SIMULATION_EVENT,ZS=ee.TERMINATE_EVENT,QS=ee.UPDATE_ELEMENTS_EVENT,eC=ee.UPDATE_ELEMENT_EVENT,tC=ee.PROCESS_INSTANCE_SHOWN_EVENT,nC=OS,iC=$S,rC=FS,oC=HS,aC=XS,za=500;function Rr(e,t,n,i,r,o){var a=this;this._elementRegistry=t,this._overlays=n,this._injector=i,this._canvas=r,this._processInstances=o,this.overlayIds={},this.handlers={},this.registerHandler("bpmn:ExclusiveGateway",iC),this.registerHandler("bpmn:IntermediateCatchEvent",rC),this.registerHandler("bpmn:SubProcess",oC),this.registerHandler("bpmn:SubProcess",nC),this.registerHandler("bpmn:StartEvent",aC),e.on(YS,za,function(s){s.simulationModeActive?a.openContextPads():a.closeContextPads()}),e.on(JS,za,function(){a.closeContextPads(),a.openContextPads()}),e.on(ZS,za,function(s){var c=s.element.parent;a.closeContextPads(c)}),e.on(QS,za,function(s){s.elements.forEach(function(c){a.closeElementContextPads(c),a.openElementContextPads(c)})}),e.on(eC,za,function(s){var c=s.element;a.closeElementContextPads(c),a.openElementContextPads(c)}),e.on(tC,function(s){var c=s.processInstanceId,u=o.getProcessInstance(c).parent;a.closeContextPads(u),a.openContextPads(u)})}Rr.prototype.registerHandler=function(e,t){var n=this._injector.instantiate(t);this.handlers[e]||(this.handlers[e]=[]),this.handlers[e].push(n)},Rr.prototype.openContextPads=function(e){var t=this;e||(e=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){t.handlers[n.type]&&kb(e,n)&&t.openElementContextPads(n)})},Rr.prototype.openElementContextPads=function(e){if(this.handlers[e.type]){var t=[];this.handlers[e.type].forEach(function(i){var r=i.createContextPads(e);r&&r.forEach(function(o){o&&t.push(o)})});var n=this;t.forEach(function(i){var r=n._overlays.add(i.element,"context-menu",{position:{top:-15,left:-15},html:i.html,show:{minZoom:.5}});n.overlayIds[i.element.id]=r})}},Rr.prototype.closeContextPads=function(e){var t=this;e||(e=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){kb(e,n)&&t.closeElementContextPads(n)})},Rr.prototype.closeElementContextPads=function(e){var t=this;e.attachers&&e.attachers.length>0&&e.attachers.forEach(function(i){t.closeElementContextPads(i)}),e.children&&e.children.length>0&&e.children.forEach(function(i){t.closeElementContextPads(i)});var n=this.overlayIds[e.id];n&&(this._overlays.remove(n),delete this.overlayIds[e.id])},Rr.$inject=["eventBus","elementRegistry","overlays","injector","canvas","processInstances"];var sC=Rr,lC=ee.TOGGLE_MODE_EVENT;function Ab(e,t,n,i,r,o,a,s){var c=this;function u(m,f,v){var g=m[f];m[f]=function(){return v.call(this,g,arguments)}}function p(m,f){u(m,f,function(v,g){if(!c.modelingDisabled)return v.apply(this,g)})}function d(m,f){u(m,f,function(v,g){if(c.modelingDisabled)throw new Error("model is read-only");return v.apply(this,g)})}this._eventBus=e,this.modelingDisabled=!1,e.on(lC,10001,function(m){var f=m.simulationModeActive;c.modelingDisabled=f,c.modelingDisabled&&(i.cancel(),t.close(),n.cancel()),a._update()}),p(t,"open"),p(n,"init"),p(i,"activate"),p(n,"init"),p(i,"activate"),d(o,"moveShape"),d(o,"updateAttachment"),d(o,"moveElements"),d(o,"moveConnection"),d(o,"layoutConnection"),d(o,"createConnection"),d(o,"createShape"),d(o,"createLabel"),d(o,"appendShape"),d(o,"removeElements"),d(o,"distributeElements"),d(o,"removeShape"),d(o,"removeConnection"),d(o,"replaceShape"),d(o,"pasteElements"),d(o,"alignElements"),d(o,"resizeShape"),d(o,"createSpace"),d(o,"updateWaypoints"),d(o,"reconnectStart"),d(o,"reconnectEnd"),u(r,"trigger",function(m,f){var v=f[0];if(!c.modelingDisabled||!function(g,E){return["undo","redo","copy","paste","removeSelection","spaceTool","lassoTool","globalConnectTool","distributeElements","alignElements","directEditing"].indexOf(E)>-1}(0,v))return m.apply(this,f)})}Ab.$inject=["eventBus","contextPad","dragging","directEditing","editorActions","modeling","palette","paletteProvider"];var cC=Ab,uC=zt,pC=ee.TOGGLE_MODE_EVENT,dC=ee.RESET_SIMULATION_EVENT,hC=ee.GENERATE_TOKEN_EVENT;function So(e,t){var n=this;this._overlays=e,t.on(pC,function(i){i.simulationModeActive||n.removeElementNotifications()}),t.on([dC,hC],function(){n.removeElementNotifications()})}So.prototype.addElementNotifications=function(e,t){var n=this;e.forEach(function(i){n.addElementNotification(i,t)})},So.prototype.addElementNotification=function(e,t){var n='<div class="element-notification '+(t.type||"")+'">'+(t.icon?'<i class="fa '+t.icon+'"></i>':"")+('<span class="text">'+t.text+"</span>"||"")+"</div>",i=uC(n);this._overlays.add(e,"element-notification",{position:{top:-15,right:15},html:i,show:{minZoom:.5}})},So.prototype.removeElementNotifications=function(e){var t=this;e?e.forEach(function(n){t.removeElementNotification(n)}):this._overlays.remove({type:"element-notification"})},So.prototype.removeElementNotification=function(e){this._overlays.remove({element:e})},So.$inject=["overlays","eventBus"];var Tb,Pb,mC=So;function Rb(){return Pb||(Pb=1,Tb=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}),Tb}try{var ec=Rb()}catch{ec=Rb()}var fC=/\s+/,vC=Object.prototype.toString;function Yi(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Yi.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~ec(t,e)||t.push(e),this.el.className=t.join(" "),this},Yi.prototype.remove=function(e){if(vC.call(e)=="[object RegExp]")return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=ec(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},Yi.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Yi.prototype.toggle=function(e,t){return this.list?(t!==void 0?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(t!==void 0?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},Yi.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(fC);return e[0]===""&&e.shift(),e},Yi.prototype.has=Yi.prototype.contains=function(e){return this.list?this.list.contains(e):!!~ec(this.array(),e)};var Ji=function(e){return new Yi(e)},Mb=Ji,Nb=Ge,Ua=Nb.is,Ib=Nb.supportedElements,yC=ee.TOGGLE_MODE_EVENT,gC=ee.GENERATE_TOKEN_EVENT,Bb=["bpmn:Process","bpmn:Collaboration","bpmn:Participant","bpmn:Lane","bpmn:TextAnnotation"];function Db(e){return e.labelTarget}function Ha(e,t,n,i,r){var o=this;this._eventBus=e,this._elementRegistry=t,this._elementNotifications=r,this._notifications=i,this.canvasParent=n.getContainer().parentNode,e.on(gC,2e4,function(a){var s=a.element;if(Ua(s,"bpmn:StartEvent"))return o.allElementsSupported()?void 0:(o.showWarnings(),Mb(o.canvasParent).add("warning"),!0)}),e.on(yC,function(a){a.simulationModeActive||Mb(o.canvasParent).remove("warning")})}Ha.prototype.allElementsSupported=function(){var e=!0;return this._elementRegistry.forEach(function(t){Ua(t,Bb)||Ua(t,Ib)||Db(t)||(e=!1)}),e},Ha.prototype.showWarnings=function(e){var t=this,n=[];this._elementRegistry.forEach(function(i){Ua(i,Bb)||Ua(i,Ib)||Db(i)||(t.showWarning(i),n.indexOf(i.type)&&(t._notifications.showNotification(i.type+" not supported","warning"),n.push(i.type)))})},Ha.prototype.showWarning=function(e){this._elementNotifications.addElementNotification(e,{type:"warning",icon:"fa-exclamation-triangle",text:"Not supported"})},Ha.$inject=["eventBus","elementRegistry","canvas","notifications","elementNotifications"];var bC=Ha,Xd=Ge.is,xC=ee.TOGGLE_MODE_EVENT,_C=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-grey-lighten-56"),EC=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-grey-darken-30");function Ga(e){return Xd(e,"bpmn:SequenceFlow")}function Mr(e,t,n){var i=this;this._elementRegistry=t,this._graphicsFactory=n,e.on(xC,function(r){r.simulationModeActive?i.setSequenceFlowsDefault():i.resetSequenceFlows()})}Mr.prototype.setSequenceFlowsDefault=function(){var e=this;this._elementRegistry.filter(function(t){return Xd(t,"bpmn:ExclusiveGateway")}).forEach(function(t){t.outgoing.filter(Ga).length&&e.setSequenceFlow(t,t.outgoing.filter(Ga)[0])})},Mr.prototype.resetSequenceFlows=function(){var e=this;this._elementRegistry.filter(function(t){return Xd(t,"bpmn:ExclusiveGateway")}).forEach(function(t){t.outgoing.filter(Ga).length&&e.resetSequenceFlow(t)})},Mr.prototype.resetSequenceFlow=function(e){e.sequenceFlow&&delete e.sequenceFlow},Mr.prototype.setSequenceFlow=function(e){var t=this,n=e.outgoing.filter(Ga);if(n.length){var i=e.sequenceFlow;e.sequenceFlow=i?function(r){var o=r.outgoing.filter(Ga),a=o.indexOf(r.sequenceFlow);return o[a+1]?o[a+1]:o[0]}(e):n[0],e.outgoing.forEach(function(r){r===e.sequenceFlow?t.setColor(r,EC):t.setColor(r,_C)})}},Mr.prototype.setColor=function(e,t){e.businessObject.di.set("stroke",t);var n=this._elementRegistry.getGraphics(e);this._graphicsFactory.update("connection",e,n)},Mr.$inject=["eventBus","elementRegistry","graphicsFactory"];var wC=Mr,tc=zt,vi=Ji,Wa=In,nc=Va,Yd=Ge,SC=Yd.getBusinessObject,En=Yd.is,CC=Yd.isTypedEvent,kC=ee.GENERATE_TOKEN_EVENT,AC=ee.CONSUME_TOKEN_EVENT,TC=ee.TOGGLE_MODE_EVENT,PC=ee.RESET_SIMULATION_EVENT,RC=ee.PROCESS_INSTANCE_CREATED_EVENT;function Jd(e){return e&&e.businessObject.name}function Co(e,t,n,i){var r=this;this._notifications=t,this._tokenSimulationPalette=n,this._canvas=i,this._init(),e.on(kC,function(o){var a=o.element,s=Jd(a);if(En(a,"bpmn:BusinessRuleTask"))r.log(s||"Business Rule Task","info","bpmn-icon-business-rule");else if(En(a,"bpmn:CallActivity"))r.log(s||"Call Activity","info","bpmn-icon-call-activity");else if(En(a,["bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent"]))r.log(s||"Intermediate Event","info","bpmn-icon-intermediate-event-none");else if(En(a,"bpmn:ManualTask"))r.log(s||"Manual Task","info","bpmn-icon-manual");else if(En(a,"bpmn:ScriptTask"))r.log(s||"Script Task","info","bpmn-icon-script");else if(En(a,"bpmn:ServiceTask"))r.log(s||"Service Task","info","bpmn-icon-service");else if(En(a,"bpmn:StartEvent"))r.log(s||"Start Event","info","bpmn-icon-start-event-none");else if(En(a,"bpmn:Task"))r.log(s||"Task","info","bpmn-icon-task");else if(En(a,"bpmn:UserTask"))r.log(s||"User Task","info","bpmn-icon-user");else if(En(a,"bpmn:ExclusiveGateway")){if(a.outgoing.length<2)return;var c=Jd(a.sequenceFlow),u=s||"Gateway";c&&(u=u.concat(' <i class="fa fa-angle-right" aria-hidden="true"></i> '+c)),r.log(u,"info","bpmn-icon-gateway-xor")}}),e.on(AC,function(o){var a=o.element,s=Jd(a);En(a,"bpmn:EndEvent")&&(CC(SC(a),"bpmn:TerminateEventDefinition")?r.log(s||"Terminate End Event","info","bpmn-icon-end-event-terminate"):r.log(s||"End Event","info","bpmn-icon-end-event-none"))}),e.on(RC,function(o){var a=o.processInstanceId,s=o.parent;En(s,"bpmn:Process")?r.log("Process "+a+" started","success","fa-check"):r.log("Subprocess "+a+" started","info","fa-check")}),e.on(TC,function(o){o.simulationModeActive||(r.emptyLog(),vi(r.container).add("hidden"))}),e.on(PC,function(o){r.emptyLog(),vi(r.container).add("hidden")})}Co.prototype._init=function(){var e=this;this.container=tc('<div class="token-simulation-log hidden"><div class="header"><i class="fa fa-align-left"></i><button class="close"><i class="fa fa-times" aria-hidden="true"></i></button></div><div class="content"><p class="entry placeholder">No Entries</p></div></div>'),this.placeholder=nc(".placeholder",this.container),this.content=nc(".content",this.container),Wa.bind(this.content,"wheel",function(t){t.stopPropagation()}),Wa.bind(this.content,"mousedown",function(t){t.stopPropagation()}),this.close=nc(".close",this.container),Wa.bind(this.close,"click",function(){vi(e.container).add("hidden")}),this.icon=nc(".fa-align-left",this.container),Wa.bind(this.icon,"click",function(){vi(e.container).add("hidden")}),this._canvas.getContainer().appendChild(this.container),this.paletteEntry=tc('<div class="entry" title="Show Simulation Log"><i class="fa fa-align-left"></i></div>'),Wa.bind(this.paletteEntry,"click",function(){vi(e.container).remove("hidden")}),this._tokenSimulationPalette.addEntry(this.paletteEntry,3)},Co.prototype.toggle=function(){var e=this.container;vi(e).has("hidden")?vi(e).remove("hidden"):vi(e).add("hidden")},Co.prototype.log=function(e,t,n){vi(this.placeholder).add("hidden");var i,r=new Date,o=r.toLocaleTimeString()+":"+r.getUTCMilliseconds();this._notifications.showNotification(e,t,n),n||(n="fa-info"),i=n.includes("bpmn")?'<span class="icon '+n+'">':'<i class="icon fa '+n+'"></i>';var a=tc('<p class="entry '+t+'"><span class="date">'+o+"</span>"+i+"</span>"+e+"</p>");this.content.appendChild(a),this.content.scrollTop=this.content.scrollHeight},Co.prototype.emptyLog=function(){for(;this.content.firstChild;)this.content.removeChild(this.content.firstChild);this.placeholder=tc('<p class="entry placeholder">No Entries</p>'),this.content.appendChild(this.placeholder)},Co.$inject=["eventBus","notifications","tokenSimulationPalette","canvas"];var MC=Co,Ob=zt,NC=ee.TOGGLE_MODE_EVENT;function qa(e,t){var n=this;this._eventBus=e,this._canvas=t,this._init(),e.on(NC,function(i){i.simulationModeActive||n.removeAll()})}qa.prototype._init=function(){this.container=Ob('<div class="notifications"></div>'),this._canvas.getContainer().appendChild(this.container)},qa.prototype.showNotification=function(e,t,n){var i;n||(n="fa-info"),i=n.includes("bpmn")?'<i class="'+n+'"></i>':'<i class="fa '+n+'"></i>';var r=Ob('<div class="notification '+t+'"><span class="icon">'+i+"</span>"+e+"</div>");for(this.container.appendChild(r);this.container.children.length>5;)this.container.children[0].remove();setTimeout(function(){r.remove()},2e3)},qa.prototype.removeAll=function(){for(;this.container.children.length;)this.container.children[0].remove()},qa.$inject=["eventBus","canvas"];var IC=qa,BC=zt,Nr=Ji,DC=In,OC=ee.TOGGLE_MODE_EVENT,LC=ee.PLAY_SIMULATION_EVENT,jC=ee.PAUSE_SIMULATION_EVENT,VC=ee.RESET_SIMULATION_EVENT,$C=ee.ANIMATION_CREATED_EVENT,FC=ee.PROCESS_INSTANCE_CREATED_EVENT,Lb='<i class="fa fa-play"></i>';function Zi(e,t,n,i){var r=this;this._eventBus=e,this._tokenSimulationPalette=t,this._notifications=n,this.canvasParent=i.getContainer().parentNode,this.isActive=!1,this.isPaused=!1,this._init(),e.on(FC,function(o){o.parent.parent||(r.activate(),r.unpause(),n.showNotification("Start Simulation","info"))}),e.on([VC,OC],function(){r.deactivate(),r.unpause()}),e.on($C,function(o){var a=o.animation;r.isPaused&&a.pause()})}Zi.prototype._init=function(){this.paletteEntry=BC('<div class="entry disabled" title="Play/Pause Simulation">'+Lb+"</div>"),DC.bind(this.paletteEntry,"click",this.toggle.bind(this)),this._tokenSimulationPalette.addEntry(this.paletteEntry,1)},Zi.prototype.toggle=function(){this.isActive&&(this.isPaused?this.unpause():this.pause())},Zi.prototype.pause=function(){this.isActive&&(Nr(this.paletteEntry).remove("active"),Nr(this.canvasParent).add("paused"),this.paletteEntry.innerHTML=Lb,this._eventBus.fire(jC),this._notifications.showNotification("Pause Simulation","info"),this.isPaused=!0)},Zi.prototype.unpause=function(){this.isActive&&(Nr(this.paletteEntry).add("active"),Nr(this.canvasParent).remove("paused"),this.paletteEntry.innerHTML='<i class="fa fa-pause"></i>',this._eventBus.fire(LC),this._notifications.showNotification("Play Simulation","info"),this.isPaused=!1)},Zi.prototype.activate=function(){this.isActive=!0,Nr(this.paletteEntry).remove("disabled")},Zi.prototype.deactivate=function(){this.isActive=!1,Nr(this.paletteEntry).remove("active"),Nr(this.paletteEntry).add("disabled")},Zi.$inject=["eventBus","tokenSimulationPalette","notifications","canvas"];var zC=Zi,UC=ee.TOGGLE_MODE_EVENT;function Ka(e,t,n){var i=this;this._elementRegistry=t,this._graphicsFactory=n,this.elementColors={},e.on(UC,5e4,function(r){r.simulationModeActive?i.preserveColors():i.resetColors()})}Ka.prototype.preserveColors=function(){var e=this;this._elementRegistry.forEach(function(t){e.elementColors[t.id]={stroke:t.businessObject.di.get("stroke"),fill:t.businessObject.di.get("fill")},e.setColor(t,"#000","#fff")})},Ka.prototype.resetColors=function(){var e=this;this._elementRegistry.forEach(function(t){e.elementColors[t.id]&&e.setColor(t,e.elementColors[t.id].stroke,e.elementColors[t.id].fill)}),this.elementColors={}},Ka.prototype.setColor=function(e,t,n){var i=e.businessObject;i.di.set("stroke",t),i.di.set("fill",n);var r=this._elementRegistry.getGraphics(e),o=e.waypoints?"connection":"shape";this._graphicsFactory.update(o,e,r)},Ka.$inject=["eventBus","elementRegistry","graphicsFactory"];var HC=Ka,GC=ee.TOGGLE_MODE_EVENT,WC=ee.RESET_SIMULATION_EVENT;function ic(e){this.nextProcessInstanceId=1,e.on(GC,this.reset.bind(this)),e.on(WC,this.reset.bind(this))}ic.prototype.getNext=function(){var e=this.nextProcessInstanceId;return this.nextProcessInstanceId++,e},ic.prototype.reset=function(){this.nextProcessInstanceId=1},ic.$inject=["eventBus"];var qC=ic,KC=ee.TOGGLE_MODE_EVENT,XC=ee.PROCESS_INSTANCE_CREATED_EVENT,YC=ee.PROCESS_INSTANCE_FINISHED_EVENT,JC=ee.PROCESS_INSTANCE_SHOWN_EVENT,ZC=ee.PROCESS_INSTANCE_HIDDEN_EVENT;function Xa(e,t,n,i){var r=this;this._animation=e,this._eventBus=t,this._processInstances=n,this._elementRegistry=i,this._eventBus.on(XC,500,function(o){var a=o.parent,s=o.processInstanceId,c=n.getProcessInstances(a).filter(function(u){return!u.isFinished});c.length===1?r.showProcessInstance(s,a):c.length>1&&r.hideProcessInstance(s)}),this._eventBus.on(YC,500,function(o){var a=o.parent,s=o.processInstanceId,c=n.getProcessInstances(a).filter(function(u){return s!==u.processInstanceId&&!u.isFinished});c.length&&s===a.shownProcessInstance?r.showProcessInstance(c[0].processInstanceId,a):delete a.shownProcessInstance,a.parent||i.forEach(function(u){delete u.shownProcessInstance})}),t.on(KC,function(){i.forEach(function(o){delete o.shownProcessInstance})})}Xa.prototype.showProcessInstance=function(e,t){this._animation.showProcessInstanceAnimations(e),t.shownProcessInstance=e,this._eventBus.fire(JC,{processInstanceId:e})},Xa.prototype.hideProcessInstance=function(e){this._animation.hideProcessInstanceAnimations(e),this._eventBus.fire(ZC,{processInstanceId:e})},Xa.prototype.showNext=function(e){var t=this,n=this._processInstances.getProcessInstances(e),i=e.shownProcessInstance,r=0;for(let o=0;o<n.length&&n[o].processInstanceId!==i;o++)r++;n.forEach(function(o){t.hideProcessInstance(o.processInstanceId)}),r===n.length-1?this.showProcessInstance(n[0].processInstanceId,e):this.showProcessInstance(n[r+1].processInstanceId,e)},Xa.$inject=["animation","eventBus","processInstances","elementRegistry"];var QC=Xa,ek=ee.TOGGLE_MODE_EVENT,tk=ee.RESET_SIMULATION_EVENT,nk=ee.PROCESS_INSTANCE_CREATED_EVENT,ik=ee.PROCESS_INSTANCE_FINISHED_EVENT;function Ir(e,t){var n=this;this._eventBus=e,this._processInstanceIds=t,this.processInstances=[],e.on([ek,tk],function(){n.processInstances=[]})}Ir.prototype.create=function(e,t){var n=this._processInstanceIds.getNext(),i={parent:e,processInstanceId:n,parentProcessInstanceId:t};return this.processInstances.push(i),this._eventBus.fire(nk,i),n},Ir.prototype.remove=function(e){this.processInstances=this.processInstances.filter(function(t){return t.processInstanceId!==e})},Ir.prototype.finish=function(e){var t=this.processInstances.find(function(n){return n.processInstanceId===e});this._eventBus.fire(ik,t),t.isFinished=!0},Ir.prototype.getProcessInstances=function(e,t){if(!e)return this.processInstances;var n=this.processInstances.filter(function(i){return i.parent===e});return t&&t.includeFinished!==!0&&(n=n.filter(function(i){return!i.isFinished})),n},Ir.prototype.getProcessInstance=function(e){return this.processInstances.find(function(t){return t.processInstanceId===e})},Ir.$inject=["eventBus","processInstanceIds"];var rk=Ir,ok=zt,jb=Ji,ak=In,sk=Ge.is,lk=ee.TOGGLE_MODE_EVENT,ck=ee.GENERATE_TOKEN_EVENT,uk=ee.RESET_SIMULATION_EVENT;function rc(e,t,n,i){var r=this;this._eventBus=e,this._tokenSimulationPalette=t,this._notifications=n,this._elementRegistry=i,this._init(),e.on(ck,function(o){sk(o.element,"bpmn:StartEvent")&&jb(r.paletteEntry).remove("disabled")}),e.on(lk,function(o){o.simulationModeActive||r.resetSimulation()})}rc.prototype._init=function(){var e=this;this.paletteEntry=ok('<div class="entry disabled" title="Reset Simulation"><i class="fa fa-refresh"></i></div>'),ak.bind(this.paletteEntry,"click",function(){e.resetSimulation(),e._notifications.showNotification("Reset Simulation","info")}),this._tokenSimulationPalette.addEntry(this.paletteEntry,2)},rc.prototype.resetSimulation=function(){jb(this.paletteEntry).add("disabled"),this._elementRegistry.forEach(function(e){e.tokenCount!==void 0&&delete e.tokenCount}),this._eventBus.fire(uk)},rc.$inject=["eventBus","tokenSimulationPalette","notifications","elementRegistry"];var pk=rc,dk=zt,oc=Ji,Zd=In,ac=Va,hk=ee.TOGGLE_MODE_EVENT;function sc(e,t,n){var i=this;this._canvas=e,this._animation=t,this._eventBus=n,this._init(),n.on(hk,function(r){r.simulationModeActive?oc(i.container).remove("hidden"):oc(i.container).add("hidden")})}sc.prototype._init=function(){var e=this;this.container=dk('<div class="set-animation-speed hidden"><i title="Set Animation Speed" class="fa fa-tachometer" aria-hidden="true"></i><div class="animation-speed-buttons"><div title="Slow" id="animation-speed-1" class="animation-speed-button"><i class="fa fa-angle-right" aria-hidden="true"></i></div><div title="Normal" id="animation-speed-2" class="animation-speed-button active"><i class="fa fa-angle-right" aria-hidden="true"></i><i class="fa fa-angle-right" aria-hidden="true"></i></div><div title="Fast" id="animation-speed-3" class="animation-speed-button"><i class="fa fa-angle-right" aria-hidden="true"></i><i class="fa fa-angle-right" aria-hidden="true"></i><i class="fa fa-angle-right" aria-hidden="true"></i></div></div></div>');var t=ac("#animation-speed-1",this.container),n=ac("#animation-speed-2",this.container),i=ac("#animation-speed-3",this.container);Zd.bind(t,"click",function(){e.setActive(t),e._animation.setAnimationSpeed(.5)}),Zd.bind(n,"click",function(){e.setActive(n),e._animation.setAnimationSpeed(1)}),Zd.bind(i,"click",function(){e.setActive(i),e._animation.setAnimationSpeed(1.5)}),this._canvas.getContainer().appendChild(this.container)},sc.prototype.setActive=function(e){ac.all(".animation-speed-button",this.container).forEach(function(t){oc(t).remove("active")}),oc(e).add("active")},sc.$inject=["canvas","animation","eventBus"];var mk=sc,Vb=zt,ko=Ji,Qd=In,eh=Va,fk=ee.TOGGLE_MODE_EVENT,vk=ee.PROCESS_INSTANCE_CREATED_EVENT,yk=ee.PROCESS_INSTANCE_FINISHED_EVENT,gk=ee.PROCESS_INSTANCE_SHOWN_EVENT,bk=ee.PROCESS_INSTANCE_HIDDEN_EVENT,xk=ee.RESET_SIMULATION_EVENT,_k=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-silver-base-97"),Ek=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-green-base-44");function $b(e){return e===null}function Bn(e,t,n,i,r,o){var a=this;this._eventBus=e,this._canvas=t,this._processInstanceSettings=n,this._processInstances=i,this._graphicsFactory=r,this._elementRegistry=o,this.highlightedElement=null,this._init(),e.on(fk,function(s){s.simulationModeActive?ko(a.container).remove("hidden"):(ko(a.container).add("hidden"),function(c){for(var u;c.childNodes.length;)u=c.childNodes[0],c.removeChild(u)}(a.container),$b(a.highlightedElement)||(a.removeHighlightFromProcess(a.highlightedElement.element),a.highlightedElement=null))}),e.on(vk,function(s){a.addInstance(s)}),e.on(yk,function(s){a.removeInstance(s)}),e.on(gk,function(s){a.setInstanceShown(s.processInstanceId)}),e.on(bk,function(s){a.setInstanceHidden(s.processInstanceId)}),e.on(xk,function(){a.removeAllInstances()})}Bn.prototype._init=function(){this.container=Vb('<div class="process-instances hidden"></div>'),this._canvas.getContainer().appendChild(this.container)},Bn.prototype.addInstance=function(e){var t=this,n=e.processInstanceId,i=e.parent,r=Vb('<div id="instance-'+n+'" class="process-instance" title="View Process Instance '+n+'">'+n+"</div>");Qd.bind(r,"click",function(){t._processInstances.getProcessInstances(i).forEach(function(o){t._processInstanceSettings.hideProcessInstance(o.processInstanceId)}),t._processInstanceSettings.showProcessInstance(n,i)}),Qd.bind(r,"mouseenter",function(){t.highlightedElement={element:i,stroke:i.businessObject.di.get("stroke"),fill:i.businessObject.di.get("fill")},t.addHighlightToProcess(i)}),Qd.bind(r,"mouseleave",function(){t.removeHighlightFromProcess(i),t.highlightedElement=null}),this.container.appendChild(r)},Bn.prototype.removeInstance=function(e){var t=e.processInstanceId,n=eh("#instance-"+t,this.container);n&&n.remove()},Bn.prototype.removeAllInstances=function(){this.container.innerHTML=""},Bn.prototype.setInstanceShown=function(e){var t=eh("#instance-"+e,this.container);t&&ko(t).add("active")},Bn.prototype.setInstanceHidden=function(e){var t=eh("#instance-"+e,this.container);t&&ko(t).remove("active")},Bn.prototype.addHighlightToProcess=function(e){this.setColor(e,Ek,_k),e.parent||ko(this._canvas.getContainer()).add("highlight")},Bn.prototype.removeHighlightFromProcess=function(e){$b(this.highlightedElement)||(this.setColor(e,this.highlightedElement.stroke,this.highlightedElement.fill),e.parent||ko(this._canvas.getContainer()).remove("highlight"))},Bn.prototype.setColor=function(e,t,n){var i=e.businessObject;i.di.set("stroke",t),i.di.set("fill",n);var r=this._elementRegistry.getGraphics(e);this._graphicsFactory.update("connection",e,r)},Bn.$inject=["eventBus","canvas","processInstanceSettings","processInstances","graphicsFactory","elementRegistry"];var wk=Bn,lc=Ge,Sk=lc.getBusinessObject,cc=lc.is,Ck=lc.isAncestor,kk=lc.isTypedEvent,Ak=ee.CONSUME_TOKEN_EVENT;function uc(e,t,n,i,r,o,a){this._animation=t,this._elementRegistry=n,this._log=i,this._elementNotifications=r,this._canvas=o,this._processInstances=a,e.on(Ak,250,function(){})}uc.prototype.isDeadlock=function(){var e=this,t=[];this._elementRegistry.forEach(function(r){r.tokenCount&&t.push(r)});var n=[],i=[];t.forEach(function(r){r.outgoing.filter(function(a){return cc(a,"bpmn:SequenceFlow")}).length||n.push(r),cc(r,"bpmn:ParallelGateway")&&r.incoming.filter(function(a){return cc(a,"bpmn:SequenceFlow")}).length>r.tokenCount&&n.push(r);var o=[];(function a(s){s.outgoing.forEach(function(c){o.indexOf(c.target)===-1&&(o.push(c.target),kk(Sk(c.target),"bpmn:TerminateEventDefinition")&&i.push(s),a(c.target))})})(r)}),t.length&&!i.length&&n.length&&!this._animation.animations.length&&(e._log.log("Deadlock","warning","fa-exclamation-triangle"),n.forEach(function(r){e._elementNotifications.addElementNotification(r,{type:"warning",icon:"fa-exclamation-triangle",text:"Deadlock"})}))},uc.prototype.isFinished=function(e,t){var n=this._processInstances.getProcessInstance(t).parent,i=!1;n||(n=this._canvas.getRootElement()),n.children.forEach(function(o){o.tokenCount&&o.tokenCount[t]&&o.tokenCount[t].length&&(i=!0)});var r=!1;if(this._animation.animations.forEach(function(o){Ck(n,o.element)&&o.processInstanceId===t&&(r=!0)}),!i&&!r)return cc(n,"bpmn:SubProcess")?this._log.log("Subprocess "+t+" finished","info","fa-check-circle"):(this._log.log("Process "+t+" finished","success","fa-check-circle"),this._elementNotifications.addElementNotification(e,{type:"success",icon:"fa-check-circle",text:"Finished"})),!0},uc.$inject=["eventBus","animation","elementRegistry","log","elementNotifications","canvas","processInstances"];var Tk=uc,Pk=zt,pc=Ji,Rk=In,Mk=Va,Fb=ee.TOGGLE_MODE_EVENT;function dc(e,t,n,i){var r=this;this._eventBus=e,this._canvas=t,this._selection=n,this._contextPad=i,this.simulationModeActive=!1,e.on("import.done",function(){r.canvasParent=r._canvas.getContainer().parentNode,r.palette=Mk(".djs-palette",r._canvas.getContainer()),r._init()})}dc.prototype._init=function(){this.container=Pk(`
  236. <div class="toggle-mode">
  237. Token Simulation <span class="toggle"><i class="fa fa-toggle-off"></i></span>
  238. </div>
  239. `),Rk.bind(this.container,"click",this.toggleMode.bind(this)),this._canvas.getContainer().appendChild(this.container)},dc.prototype.toggleMode=function(){if(this.simulationModeActive){this.container.innerHTML='Token Simulation <span class="toggle"><i class="fa fa-toggle-off"></i></span>',pc(this.canvasParent).remove("simulation"),pc(this.palette).remove("hidden"),this._eventBus.fire(Fb,{simulationModeActive:!1});var e=this._selection.get();e.length===1&&this._contextPad.open(e[0])}else this.container.innerHTML='Token Simulation <span class="toggle"><i class="fa fa-toggle-on"></i></span>',pc(this.canvasParent).add("simulation"),pc(this.palette).add("hidden"),this._eventBus.fire(Fb,{simulationModeActive:!0});this.simulationModeActive=!this.simulationModeActive},dc.$inject=["eventBus","canvas","selection","contextPad"];var Nk=dc,Ik=zt,zb=Ge.isAncestor,Bk=ee.TOGGLE_MODE_EVENT,Dk=ee.GENERATE_TOKEN_EVENT,Ok=ee.CONSUME_TOKEN_EVENT,Lk=ee.RESET_SIMULATION_EVENT,jk=ee.TERMINATE_EVENT,Vk=ee.PROCESS_INSTANCE_SHOWN_EVENT;function Br(e,t,n,i,r){var o=this;this._overlays=t,this._elementRegistry=n,this._canvas=i,this._processInstances=r,this.overlayIds={},e.on(Bk,function(a){a.simulationModeActive||o.removeTokenCounts()}),e.on(Lk,function(){o.removeTokenCounts()}),e.on(jk,function(a){var s=a.element.parent;o.removeTokenCounts(s)}),e.on([Dk,Ok],500,function(a){var s=a.element.parent;o.removeTokenCounts(s),o.addTokenCounts(s)}),e.on(Vk,function(a){var s=a.processInstanceId,c=r.getProcessInstance(s).parent;o.removeTokenCounts(c),o.addTokenCounts(c)})}Br.prototype.addTokenCounts=function(e){var t=this;e||(e=this._canvas.getRootElement());var n=e.shownProcessInstance;if(!n){var i=this._processInstances.getProcessInstances(e);if(!i.length)return;n=i[0].processInstanceId}this._elementRegistry.forEach(function(r){zb(e,r)&&t.addTokenCount(r,n)})},Br.prototype.addTokenCount=function(e,t){var n=e.tokenCount&&e.tokenCount[t];if(n){var i=this.createTokenCount(n),r=this._overlays.add(e,"token-count",{position:{bottom:10,left:-15},html:i,show:{minZoom:.5}});this.overlayIds[e.id]=r}},Br.prototype.createTokenCount=function(e){return Ik('<div class="token-count waiting">'+e+"</div>")},Br.prototype.removeTokenCounts=function(e){var t=this;e||(e=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){zb(e,n)&&t.removeTokenCount(n)})},Br.prototype.removeTokenCount=function(e){var t=this.overlayIds[e.id];t&&(this._overlays.remove(t),delete this.overlayIds[e.id])},Br.$inject=["eventBus","overlays","elementRegistry","canvas","processInstances"];var $k=Br,Ya=Ge,Fk=Ya.getBusinessObject,zk=Ya.is,Uk=Ya.isAncestor,Hk=Ya.getDescendants,Gk=Ya.isTypedEvent,Wk=ee.GENERATE_TOKEN_EVENT,qk=ee.TERMINATE_EVENT,Kk=ee.UPDATE_ELEMENTS_EVENT;function hc(e,t,n,i,r,o){this._animation=e,this._eventBus=t,this._log=n,this._simulationState=i,this._elementRegistry=r,this._processInstances=o}hc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId,i=Gk(Fk(t),"bpmn:TerminateEventDefinition"),r=zk(t.parent,"bpmn:SubProcess");i&&(this._eventBus.fire(qk,e),this._elementRegistry.forEach(function(s){Uk(t.parent,s)&&s.tokenCount&&s.tokenCount[n]&&delete s.tokenCount[n]}),this._processInstances.finish(n));var o=this._simulationState.isFinished(t,n);if(o&&this._processInstances.finish(n),(o||i)&&r){var a=this._processInstances.getProcessInstance(n);this._eventBus.fire(Wk,{element:t.parent,processInstanceId:a.parentProcessInstanceId})}this._eventBus.fire(Kk,{elements:Hk(this._elementRegistry.getAll(),t.parent)})},hc.prototype.generate=function(e){},hc.$inject=["animation","eventBus","log","simulationState","elementRegistry","processInstances"];var Xk=hc,Yk=Ge.is,Jk=ee.UPDATE_ELEMENTS_EVENT;function mc(e,t){this._eventBus=e,this._animation=t}mc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++;var i=t.outgoing,r=[];i.forEach(function(o){var a=o.target;Yk(a,"bpmn:IntermediateCatchEvent")&&r.push(a)}),this._eventBus.fire(Jk,{elements:r})},mc.prototype.generate=function(){},mc.$inject=["eventBus","animation"];var Zk=mc,Qk=ee.CONSUME_TOKEN_EVENT,eA=ee.GENERATE_TOKEN_EVENT;function fc(e,t,n){this._eventBus=e,this._animation=t,this._elementRegistry=n}fc.prototype.consume=function(e){var t=e.element;if(!t.sequenceFlow)throw new Error("no sequence flow configured for element "+t.id);this._eventBus.fire(eA,e)},fc.prototype.generate=function(e){var t=e.element,n=e.processInstanceId;if(!t.sequenceFlow)throw new Error("no sequence flow configured for element "+t.id);var i=this,r=this._elementRegistry.get(t.sequenceFlow.id);this._animation.createAnimation(r,n,function(){i._eventBus.fire(Qk,{element:r.target,processInstanceId:n})})},fc.$inject=["eventBus","animation","elementRegistry"];var tA=fc,Ub=Ge.is,nA=ee.CONSUME_TOKEN_EVENT,iA=ee.UPDATE_ELEMENT_EVENT,rA=ee.UPDATE_ELEMENTS_EVENT;function vc(e,t,n){this._animation=e,this._eventBus=t,this._elementRegistry=n}vc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++,this._eventBus.fire(iA,{element:t})},vc.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(a){return Ub(a,"bpmn:SequenceFlow")}).forEach(function(a){t._animation.createAnimation(a,i,function(){t._eventBus.fire(nA,{element:a.target,processInstanceId:i})})});var r=n.parent,o=this._elementRegistry.filter(function(a){return Ub(a,"bpmn:IntermediateCatchEvent")&&a.parent===r});this._eventBus.fire(rA,{elements:o})},vc.$inject=["animation","eventBus","elementRegistry"];var oA=vc,aA=Ge.is,sA=ee.CONSUME_TOKEN_EVENT,lA=ee.GENERATE_TOKEN_EVENT;function yc(e,t){this._animation=e,this._eventBus=t}yc.prototype.consume=function(e){this._eventBus.fire(lA,{element:e})},yc.prototype.generate=function(e){var t=this;e.outgoing.filter(function(n){return aA(n,"bpmn:SequenceFlow")}).forEach(function(n){t._animation.createAnimation(n,function(){t._eventBus.fire(sA,{element:n.target})})})},yc.$inject=["animation","eventBus"];var cA=yc,uA=Ge.is,pA=ee.CONSUME_TOKEN_EVENT,dA=ee.GENERATE_TOKEN_EVENT;function gc(e,t){this._animation=e,this._eventBus=t}gc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++,t.incoming.length===t.tokenCount[n]&&(this._eventBus.fire(dA,e),t.tokenCount[n]=0)},gc.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return uA(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(pA,{element:r.target,processInstanceId:i})})})},gc.$inject=["animation","eventBus"];var hA=gc,th=Ge.is,mA=ee.CONSUME_TOKEN_EVENT,fA=ee.UPDATE_ELEMENTS_EVENT;function bc(e,t,n,i){this._animation=e,this._eventBus=t,this._elementRegistry=n,this._processInstances=i}bc.prototype.consume=function(){},bc.prototype.generate=function(e){var t=this,n=e.element,i=e.parentProcessInstanceId,r=n.outgoing.filter(function(c){return th(c,"bpmn:SequenceFlow")}),o=n.parent,a=this._processInstances.create(o,i);if(r.forEach(function(c){t._animation.createAnimation(c,a,function(){t._eventBus.fire(mA,{element:c.target,processInstanceId:a})})}),!th(n.parent,"bpmn:SubProcess")){var s=this._elementRegistry.filter(function(c){return th(c,"bpmn:StartEvent")});this._eventBus.fire(fA,{elements:s})}},bc.$inject=["animation","eventBus","elementRegistry","processInstances"];var vA=bc,Hb=Ge.is,yA=ee.CONSUME_TOKEN_EVENT,Gb=ee.GENERATE_TOKEN_EVENT,Wb=ee.UPDATE_ELEMENT_EVENT;function xc(e,t,n){this._animation=e,this._eventBus=t,this._log=n}xc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId,i=t.children.filter(function(r){return Hb(r,"bpmn:StartEvent")})[0];i?(this._log.log("Starting Subprocess","info","fa-sign-in"),this._eventBus.fire(Gb,{element:i,parentProcessInstanceId:n})):(this._log.log("Skipping Subprocess","info","fa-angle-double-right"),this._eventBus.fire(Gb,e)),this._eventBus.fire(Wb,{element:t})},xc.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return Hb(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(yA,{element:r.target,processInstanceId:i})})}),this._eventBus.fire(Wb,{element:n})},xc.$inject=["animation","eventBus","log"];var gA=xc,bA=Ge.is,xA=ee.CONSUME_TOKEN_EVENT,_A=ee.UPDATE_ELEMENT_EVENT;function _c(e,t,n){this._animation=e,this._eventBus=t,this._elementRegistry=n}_c.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++,this._eventBus.fire(_A,{element:t})},_c.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return bA(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(xA,{element:r.target,processInstanceId:i})})})},_c.$inject=["animation","eventBus","elementRegistry"];var EA=_c,wA=Ge.is,SA=ee.CONSUME_TOKEN_EVENT,CA=ee.GENERATE_TOKEN_EVENT;function Ec(e,t){this._animation=e,this._eventBus=t}Ec.prototype.consume=function(e){this._eventBus.fire(CA,e)},Ec.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return wA(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(SA,{element:r.target,processInstanceId:i})})})},Ec.$inject=["animation","eventBus"];var kA=Xk,AA=Zk,TA=tA,PA=oA,RA=cA,MA=hA,NA=vA,IA=gA,BA=EA,DA=Ec,OA=ee.GENERATE_TOKEN_EVENT,LA=ee.CONSUME_TOKEN_EVENT;function nh(e,t,n){var i=this;this._injector=n,this.handlers={},this.registerHandler("bpmn:EndEvent",kA),this.registerHandler("bpmn:EventBasedGateway",AA),this.registerHandler("bpmn:ExclusiveGateway",TA),this.registerHandler("bpmn:IntermediateCatchEvent",PA),this.registerHandler("bpmn:IntermediateThrowEvent",RA),this.registerHandler("bpmn:ParallelGateway",MA),this.registerHandler("bpmn:StartEvent",NA),this.registerHandler("bpmn:SubProcess",IA),this.registerHandler("bpmn:BoundaryEvent",BA),this.registerHandler(["bpmn:BusinessRuleTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:Task","bpmn:UserTask"],DA),e.on(OA,function(r){var o=r.element;if(!i.handlers[o.type])throw new Error("no handler for type "+o.type);i.handlers[o.type].generate(r)}),e.on(LA,function(r){var o=r.element;if(!i.handlers[o.type])throw new Error("no handler for type "+o.type);i.handlers[o.type].consume(r)})}nh.prototype.registerHandler=function(e,t){var n=this,i=this._injector.instantiate(t);Array.isArray(e)||(e=[e]),e.forEach(function(r){n.handlers[r]=i})},nh.$inject=["eventBus","animation","injector"];var jA=nh;function qb(e,t,n,i,r,o){o.register({toggleTokenSimulation:function(){t.toggleMode()}}),o.register({togglePauseTokenSimulation:function(){n.toggle()}}),o.register({resetTokenSimulation:function(){r.resetSimulation()}}),o.register({toggleTokenSimulationLog:function(){i.toggle()}})}qb.$inject=["eventBus","toggleMode","pauseSimulation","log","resetSimulation","editorActions"];var VA=qb,$A=ee.TOGGLE_MODE_EVENT;function Kb(e,t){var n=t.get("editorActions",!1),i=t.get("keyboard",!1);if(i&&n){var r=!1;e.on("keyboard.init",function(){i.addListener(1e4,function(o){var a;wc(["t","T"],a=o.keyEvent)?n.trigger("toggleTokenSimulation"):r&&(wc(["l","L"],a)?n.trigger("toggleTokenSimulationLog"):wc([" ","Spacebar"],a)?n.trigger("togglePauseTokenSimulation"):wc(["r","R"],a)&&n.trigger("resetTokenSimulation"))})}),e.on($A,function(o){var a=o.simulationModeActive;r=!!a})}}function wc(e,t){return e.indexOf(t.key)>-1}Kb.$inject=["eventBus","injector"];var FA=Kb,zA=zt,Xb=Ji,UA=ee.TOGGLE_MODE_EVENT;function Sc(e,t){var n=this;this._canvas=t,this.entries=[],this._init(),e.on(UA,function(i){i.simulationModeActive?Xb(n.container).remove("hidden"):Xb(n.container).add("hidden")})}Sc.prototype._init=function(){this.container=zA('<div class="token-simulation-palette hidden"></div>'),this._canvas.getContainer().appendChild(this.container)},Sc.prototype.addEntry=function(e,t){var n=0;this.entries.forEach(function(i){t>=i.index&&n++}),this.container.insertBefore(e,this.container.childNodes[n]),this.entries.push({entry:e,index:t})},Sc.$inject=["eventBus","canvas"];const HA=Rx({__init__:["animation","contextPads","disableModeling","elementNotifications","elementSupport","exclusiveGatewaySettings","log","notifications","pauseSimulation","preserveElementColors","processInstanceIds","processInstanceSettings","processInstances","resetSimulation","setAnimationSpeed","showProcessInstance","simulationState","toggleMode","tokenCount","tokenSimulationBehavior","tokenSimulationEditorActions","tokenSimulationKeyboardBindings","tokenSimulationPalette"],animation:["type",RS],contextPads:["type",sC],disableModeling:["type",cC],elementNotifications:["type",mC],elementSupport:["type",bC],exclusiveGatewaySettings:["type",wC],log:["type",MC],notifications:["type",IC],pauseSimulation:["type",zC],preserveElementColors:["type",HC],processInstanceIds:["type",qC],processInstanceSettings:["type",QC],processInstances:["type",rk],resetSimulation:["type",pk],setAnimationSpeed:["type",mk],showProcessInstance:["type",wk],simulationState:["type",Tk],toggleMode:["type",Nk],tokenCount:["type",$k],tokenSimulationBehavior:["type",jA],tokenSimulationEditorActions:["type",VA],tokenSimulationKeyboardBindings:["type",FA],tokenSimulationPalette:["type",Sc]}),GA={name:"Camunda",uri:"http://camunda.org/schema/1.0/bpmn",prefix:"camunda",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity","bpmn:SignalEventDefinition"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","camunda:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"camunda:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"},{name:"modelerTemplateVersion",isAttr:!0,type:"Integer"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"},{name:"candidateStrategy",isAttr:!0,type:"String"},{name:"candidateParam",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["camunda:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","camunda:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","camunda:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike","camunda:ExecutionListener","camunda:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["camunda:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["camunda:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0},{name:"id",type:"String",isAttr:!0},{name:"eventDefinitions",type:"bpmn:TimerEventDefinition",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvents",isAttr:!0,type:"String"}]}],emumerations:[]},WA={name:"Activiti",uri:"http://activiti.org/bpmn",prefix:"activiti",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","activiti:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"activiti:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0},{name:"executionListener",isAbstract:!0,type:"Expression"}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"multiinstance_type",superClass:["Element"]},{name:"multiinstance_condition",superClass:["Element"]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"},{name:"multiinstance_condition",isAttr:!0,type:"String"},{name:"candidateStrategy",isAttr:!0,type:"String"},{name:"candidateParam",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["activiti:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","activiti:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["activiti:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","activiti:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["activiti:ServiceTaskLike","activiti:ExecutionListener","activiti:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["activiti:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["activiti:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormProperty",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvent",isAttr:!0,type:"String"}]}],emumerations:[]},qA={name:"Flowable",uri:"http://flowable.org/bpmn",prefix:"flowable",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","flowable:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"flowable:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"},{name:"formType",isAttr:!0,type:"String"},{name:"formReadOnly",isAttr:!0,type:"Boolean",default:!1},{name:"formInit",isAttr:!0,type:"Boolean",default:!0}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"},{name:"candidateStrategy",isAttr:!0,type:"String"},{name:"candidateParam",isAttr:!0,type:"String"}]},{name:"Assignee",supperClass:"Element",meta:{allowedIn:["*"]},properties:[{name:"label",type:"String",isAttr:!0},{name:"viewId",type:"Number",isAttr:!0}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"},{name:"calledElementType",isAttr:!0,type:"String"},{name:"processInstanceName",isAttr:!0,type:"String"},{name:"inheritBusinessKey",isAttr:!0,type:"Boolean"},{name:"businessKey",isAttr:!0,type:"String"},{name:"inheritVariables",isAttr:!0,type:"Boolean"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["flowable:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","flowable:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Button",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"code",type:"String",isAttr:!0},{name:"isHide",type:"String",isAttr:!0},{name:"next",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]},{name:"Assignee",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0},{name:"condition",type:"String",isAttr:!0},{name:"operationType",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","flowable:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike","flowable:ExecutionListener","flowable:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"ChildField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["flowable:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["flowable:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0},{name:"children",type:"ChildField",isMany:!0},{name:"extensionElements",type:"bpmn:ExtensionElements",isMany:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvent",isAttr:!0,type:"String"}]},{name:"Condition",superClass:["Element"],meta:{allowedIn:["bpmn:SequenceFlow"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"field",type:"String",isAttr:!0},{name:"compare",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0},{name:"logic",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]},{name:"AssignStartUserHandlerType",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"value",type:"Integer",isBody:!0}]},{name:"RejectHandlerType",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"value",type:"Integer",isBody:!0}]},{name:"RejectReturnTaskId",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"value",type:"String",isBody:!0}]},{name:"AssignEmptyHandlerType",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"value",type:"Integer",isBody:!0}]},{name:"AssignEmptyUserIds",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"value",type:"String",isBody:!0}]},{name:"ButtonsSetting",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"flowable:id",type:"Integer",isAttr:!0},{name:"flowable:enable",type:"Boolean",isAttr:!0},{name:"flowable:displayName",type:"String",isAttr:!0}]},{name:"FieldsPermission",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"flowable:field",type:"String",isAttr:!0},{name:"flowable:title",type:"String",isAttr:!0},{name:"flowable:permission",type:"String",isAttr:!0}]},{name:"BoundaryEventType",superClass:["Element"],meta:{allowedIn:["bpmn:BoundaryEvent"]},properties:[{name:"value",type:"Integer",isBody:!0}]},{name:"TimeoutHandlerType",superClass:["Element"],meta:{allowedIn:["bpmn:BoundaryEvent"]},properties:[{name:"value",type:"Integer",isBody:!0}]},{name:"ApproveType",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"value",type:"Integer",isBody:!0}]},{name:"ApproveMethod",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"value",type:"Integer",isBody:!0}]},{name:"CandidateStrategy",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"value",type:"Integer",isBody:!0}]},{name:"CandidateParam",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"value",type:"String",isBody:!0}]}],emumerations:[]};function Ao(e){const t=this;e.on("moddleCopy.canCopyProperty",function(n){const i=n.property,r=n.parent;return t.canCopyProperty(i,r)})}function To(e,t){return e&&rt(e.$instanceOf)&&e.$instanceOf(t)}function Yb(e,t){return Gt(t,function(n){return To(e,n)})}function Dn(e,t){return t?To(e,t)?e:e.$parent?Dn(e.$parent,t):void 0:e.$parent}Ao.$inject=["eventBus"],Ao.prototype.canCopyProperty=function(e,t){return!(vt(e)&&!function(n,i){const r=n.$type&&n.$model.getTypeDescriptor(n.$type),o=r&&r.meta&&r.meta.allowedIn;return!(o&&!function(a){return a.indexOf("*")!==-1}(o))||Gt(o,function(a){return Dn(i,a)})}(e,t))&&!(To(e,"camunda:InputOutput")&&!this.canHostInputOutput(t))&&!(Yb(e,["camunda:Connector","camunda:Field"])&&!this.canHostConnector(t))&&!(To(e,"camunda:In")&&!this.canHostIn(t))&&void 0},Ao.prototype.canHostInputOutput=function(e){if(Dn(e,"camunda:Connector"))return!0;const t=Dn(e,"bpmn:FlowNode");return!(!t||Yb(t,["bpmn:StartEvent","bpmn:Gateway","bpmn:BoundaryEvent"])||To(t,"bpmn:SubProcess")&&t.get("triggeredByEvent"))},Ao.prototype.canHostConnector=function(e){return!To(Dn(e,"camunda:ServiceTaskLike"),"bpmn:MessageEventDefinition")||Dn(e,"bpmn:IntermediateThrowEvent")||Dn(e,"bpmn:EndEvent")},Ao.prototype.canHostIn=function(e){return!!Dn(e,"bpmn:CallActivity")||!Dn(e,"bpmn:SignalEventDefinition")||Dn(e,"bpmn:IntermediateThrowEvent")||Dn(e,"bpmn:EndEvent")};const KA={__init__:["camundaModdleExtension"],camundaModdleExtension:["type",Ao]},XA={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function ih(e,t){return e&&typeof e.$instanceOf=="function"&&e.$instanceOf(t)}function rh(e,t){return(n=e)&&n.length&&Gt(e,function(i){return ih(i,t)});var n}function oh(e,t,n){const i=t.name,r=XA[i.replace(/activiti:/,"")];return i===e&&function(o,a){return Gt(a,function(s){return ih(o,s)})}(n,r)}function ah(e){e.on("property.clone",function(t){const n=t.newElement,i=t.propertyDescriptor;this.canCloneProperty(n,i)},this)}ah.$inject=["eventBus"],ah.prototype.canCloneProperty=function(e,t){return oh("activiti:FailedJobRetryTimeCycle",t,e)?rh(e.eventDefinitions,"bpmn:TimerEventDefinition")||rh(e.eventDefinitions,"bpmn:SignalEventDefinition")||ih(e.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):oh("activiti:Connector",t,e)||oh("activiti:Field",t,e)?rh(e.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const YA={__init__:["ActivitiModdleExtension"],ActivitiModdleExtension:["type",ah]},JA={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function sh(e,t){return e&&typeof e.$instanceOf=="function"&&e.$instanceOf(t)}function lh(e,t){return(n=e)&&n.length&&Gt(e,function(i){return sh(i,t)});var n}function ch(e,t,n){const i=t.name,r=JA[i.replace(/flowable:/,"")];return i===e&&function(o,a){return Gt(a,function(s){return sh(o,s)})}(n,r)}function uh(e){e.on("property.clone",function(t){const n=t.newElement,i=t.propertyDescriptor;this.canCloneProperty(n,i)},this)}uh.$inject=["eventBus"],uh.prototype.canCloneProperty=function(e,t){return ch("flowable:FailedJobRetryTimeCycle",t,e)?lh(e.eventDefinitions,"bpmn:TimerEventDefinition")||lh(e.eventDefinitions,"bpmn:SignalEventDefinition")||sh(e.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):ch("flowable:Connector",t,e)||ch("flowable:Field",t,e)?lh(e.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const ZA={__init__:["FlowableModdleExtension"],FlowableModdleExtension:["type",uh]};var Oe,Qi,QA=Object.defineProperty,Cc=Object.getOwnPropertySymbols,Jb=Object.prototype.hasOwnProperty,Zb=Object.prototype.propertyIsEnumerable,ph=(e,t,n)=>t in e?QA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qb=(e,t)=>{for(var n in t||(t={}))Jb.call(t,n)&&ph(e,n,t[n]);if(Cc)for(var n of Cc(t))Zb.call(t,n)&&ph(e,n,t[n]);return e},er=(e,t,n)=>(ph(e,typeof t!="symbol"?t+"":t,n),n);function On(e){return e==null}function dh(e){return typeof e=="string"}(Qi=Oe||(Oe={})).Root="Root",Qi.Declaration="Declaration",Qi.Comment="Comment",Qi.DocumentType="DocumentType",Qi.Element="Element",Qi.Text="Text",Qi.Instruction="Instruction",Qi.CDATA="CDATA";var wn=class{constructor(e,t=null,n=null){er(this,"name"),er(this,"type"),er(this,"parent"),er(this,"children"),er(this,"attributes"),er(this,"value"),er(this,"selfClosing"),er(this,"prefix"),this.name="",this.type=e,this.parent=t,this.value=n,this.children=null,this.attributes={},this.selfClosing=!1,this.prefix=""}setName(e){return this.name=e,this}setType(e){return this.type=e,this}setParent(e){return this.parent=e,this}setChildren(e){return this.children=e&&Array.from(e),this}setAttributes(e){return this.attributes=Qb({},e),this}setValue(e){return this.value=e,this}setSelfClosing(e){return this.selfClosing=e,this}setPrefix(e){return this.prefix=e,this}addAttribute(e,t){return this.attributes[e]=t,this}removeAttribute(e){return delete this.attributes[e],this}addChild(e){return e===this||(this.children||(this.children=[]),this.children.push(e),e.parent!==this&&(e.parent=this)),this}removeChild(e){if(this.children&&this.children.length){const t=this.children.findIndex(n=>n===e);~t&&(this.children.splice(t,1),e.parent=null)}return this}toJsObject(){return{name:this.name||void 0,prefix:this.prefix||void 0,type:this.type,attributes:Object.keys(this.attributes).length?this.attributes:void 0,value:On(this.value)?void 0:this.value,selfClosing:this.selfClosing||void 0,children:(this.type===Oe.Element||this.type===Oe.Root)&&this.children&&this.children.length?this.children.map(e=>e.toJSON()):void 0}}toXmlString(e=" ",t=`
  240. `,n=0){const i=e.repeat(n);let r="";switch(this.type){case Oe.Root:r+=this.children&&this.children.length?this.children.map(o=>o.toXmlString(e,t,n)).join(t):"";break;case Oe.Element:{if(!this.name)return"";const o=this.prefix?`${this.prefix}:${this.name}`:this.name;r+=`${i}<${o}`;const a=ex(this.attributes||{});a&&(r+=` ${a}`),this.children&&this.children.length?r+=`>${t}${this.children.map(s=>s.toXmlString(e,t,n+1)).join(t)}${t}${i}</${o}>`:r+=this.selfClosing?" />":`></${o}>`;break}case Oe.CDATA:r+=`${i}<![CDATA[${On(this.value)?"":this.value}]]>`;break;case Oe.Text:r+=On(this.value)?"":`${i}${this.value}`;break;case Oe.DocumentType:r+=On(this.value)?"":`${i}<!DOCTYPE ${this.value}>`;break;case Oe.Comment:r+=`${i}<!-- ${On(this.value)?"":this.value+" "}-->`;break;case Oe.Declaration:if(r+=`${i}<?xml `,!this.attributes||On(this.attributes.version))r+='version="1.0" ';else{const o=parseFloat(this.attributes.version);r+=`version="${Number.isNaN(o)?"1.0":o.toFixed(1)}" `}if(this.attributes){const o=((a,s)=>{var c={};for(var u in a)Jb.call(a,u)&&s.indexOf(u)<0&&(c[u]=a[u]);if(a!=null&&Cc)for(var u of Cc(a))s.indexOf(u)<0&&Zb.call(a,u)&&(c[u]=a[u]);return c})(this.attributes,["version"]);o&&(r+=ex(o))}r+="?>";break;case Oe.Instruction:r+=On(this.value)?"":`${i}<?${this.value}?>`}return r}toJSON(){return this.toJsObject()}toString(){return this.toXmlString("","")}};function ex(e){return Object.keys(e).map(t=>{const n=e[t];return On(n)?null:function(i){return typeof i=="boolean"}(n)?n?t:null:`${t}="${n}"`}).filter(Boolean).join(" ")}var tx=e=>e,nx={ignoreAttributes:!1,parseNodeValue:!0,trimValues:!0,prefixInName:!1,valueProcessor:tx,attributeProcessor:tx},eT=Object.keys(nx),Dr="Tag is not closed.";function Po(e,t,n,i){const r=e.indexOf(t,n);if(!~r)throw new Error(i);return r+t.length-1}function Or(e,t,n,i){return n?(i.trimValues&&(n=n.trim()),ix(i.valueProcessor(n,t,e),i.parseNodeValue)):null}function ix(e,t){return t&&dh(e)?(e=e.trim())==="true"||e!=="false"&&function(n){const i=parseFloat(n);return Number.isNaN(i)?n:i}(e):On(e)?null:e}function hh(e){return On(e)?"":dh(e)?e:String(e)}var tT=/[^\s=]+\s*(=\s*['"][\s\S]*?['"])?/g;function mh(e,t,n){const i=(e=e.replace(/\r?\n/g," ")).match(tT)||[],r={};for(let o=0;o<i.length;o++){const a=i[o];let[s,c]=a.split("=");s=s.trim(),dh(c)?(c=c.substring(1,c.length-1),n.trimValues&&(c=c.trim()),r[s]=ix(n.attributeProcessor(c,s,t),n.parseNodeValue)):r[s]=!0}return r}const nT={class:"my-process-designer"},iT={class:"my-process-designer__header",style:{"z-index":"999",display:"table-row-group"}},rT={style:{color:"#409eff"}},oT={class:"my-process-designer__container"},aT={class:"hljs"},kc=et({name:"MyProcessDesigner",__name:"ProcessDesigner",props:{value:String,processId:String,processName:String,formId:Number,translations:{type:Object,default:()=>{}},additionalModel:[Object,Array],moddleExtension:{type:Object,default:()=>{}},onlyCustomizeAddi:{type:Boolean,default:!1},onlyCustomizeModdle:{type:Boolean,default:!1},simulation:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},prefix:{type:String,default:"camunda"},events:{type:Array,default:()=>["element.click"]},headerButtonSize:{type:String,default:"small",validator:e=>["default","medium","small","mini"].indexOf(e)!==-1},headerButtonType:{type:String,default:"primary",validator:e=>["default","primary","success","warning","danger","info"].indexOf(e)!==-1}},emits:["destroy","init-finished","save","commandStack-changed","input","change","canvas-viewbox-changed","element-click"],setup(e,{emit:t}){const n=F(),i=F(),r=t,o=e;qe(()=>o.value,y=>{y&&a&&E(y)},{immediate:!0}),qe([()=>o.processId,()=>o.processName],([y,x])=>{y&&x&&!o.value&&E(null)},{immediate:!0}),Lc("configGlobal",o);let a=null;const s=F(1),c=F(!1),u=F(!1),p=F(""),d=F("xml"),m=F(!1),f=F(!1),v=Fr(()=>{console.log(o.additionalModel,"additionalModel");const y=[];if(o.onlyCustomizeAddi)return Object.prototype.toString.call(o.additionalModel)=="[object Array]"?o.additionalModel||[]:[o.additionalModel];Object.prototype.toString.call(o.additionalModel)=="[object Array]"?y.push(...o.additionalModel):o.additionalModel&&y.push(o.additionalModel);const x={translate:["value",(C=o.translations||pS,function(N,O){return O=O||{},(N=C[N]||N).replace(/{([^}]+)}/g,function(B,H){let q=O[H];return C[O[H]]!==null&&C[O[H]]!==void 0&&(q=C[O[H]]),q||"{"+H+"}"})})]};var C;return y.push(x),o.simulation&&y.push(HA),console.log(o.prefix,"props.prefix "),o.prefix==="camunda"&&y.push(KA),o.prefix==="flowable"&&y.push(ZA),o.prefix==="activiti"&&y.push(YA),y}),g=Fr(()=>{console.log(o.onlyCustomizeModdle,"props.onlyCustomizeModdle"),console.log(o.moddleExtension,"props.moddleExtension"),console.log(o.prefix,"props.prefix");const y={};if(o.onlyCustomizeModdle)return o.moddleExtension||null;if(o.moddleExtension)for(let x in o.moddleExtension)y[x]=o.moddleExtension[x];return o.prefix==="activiti"&&(y.activiti=WA),o.prefix==="flowable"&&(y.flowable=qA),o.prefix==="camunda"&&(y.camunda=GA),y});console.log(v,"additionalModules()"),console.log(g,"moddleExtensions()");const E=async y=>{console.log(y,"xml");let x=o.processId||`Process_${new Date().getTime()}`,C=o.processName||`\u4E1A\u52A1\u6D41\u7A0B_${new Date().getTime()}`,N=y||(O=x,B=C,(H=o.prefix)||(H="camunda"),`<?xml version="1.0" encoding="UTF-8"?>
  241. <bpmn2:definitions
  242. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  243. xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"
  244. xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
  245. xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
  246. xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
  247. id="diagram_${O}"
  248. targetNamespace="${{activiti:"http://activiti.org/bpmn",camunda:"http://bpmn.io/schema/bpmn",flowable:"http://flowable.org/bpmn"}[H]}">
  249. <bpmn2:process id="${O}" name="${B}" isExecutable="true">
  250. </bpmn2:process>
  251. <bpmndi:BPMNDiagram id="BPMNDiagram_1">
  252. <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${O}">
  253. </bpmndi:BPMNPlane>
  254. </bpmndi:BPMNDiagram>
  255. </bpmn2:definitions>`);var O,B,H;try{let{warnings:q}=await a.importXML(N);console.log(q,"warnings"),q&&q.length&&q.forEach(U=>console.warn(U))}catch(q){console.error(`[Process Designer Warn]: ${q.message||q}`)}},_=async y=>{try{if(y==="xml"||y==="bpmn"){const{err:C,xml:N}=await a.saveXML();C&&console.error(`[Process Designer Warn ]: ${C.message||C}`);let{href:O,filename:B}=b(y.toUpperCase(),N);x(O,B)}else{const{err:C,svg:N}=await a.saveSVG();if(C)return console.error(C);let{href:O,filename:B}=b("SVG",N);x(O,B)}}catch(C){console.error(`[Process Designer Warn ]: ${C.message||C}`)}function x(C,N){if(C&&N){let O=document.createElement("a");O.download=N,O.href=C,O.click(),URL.revokeObjectURL(O.href)}}},b=(y,x)=>({filename:`diagram.${y}`,href:`data:application/${y==="svg"?"text/xml":"bpmn20-xml"};charset=UTF-8,${encodeURIComponent(x)}`,data:x}),w=()=>{const y=i.value.files[0],x=new FileReader;x.readAsText(y),x.onload=function(){let C=this.result;E(C)}},S=()=>{u.value=!u.value,console.log(a.get("toggleMode","strict"),"bpmnModeler.get('toggleMode')"),o.simulation&&a.get("toggleMode","strict").toggleMode()},k=y=>{const x=a.get("alignElements"),C=a.get("selection").get();!C||C.length<=1?vx.warning("\u8BF7\u6309\u4F4F Shift \u952E\u9009\u62E9\u591A\u4E2A\u5143\u7D20\u5BF9\u9F50"):Vr.confirm("\u81EA\u52A8\u5BF9\u9F50\u53EF\u80FD\u9020\u6210\u56FE\u5F62\u53D8\u5F62\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F","\u8B66\u544A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(()=>{x.trigger(C,y)})},l=()=>{console.log(a.saveXML,"bpmnModeler"),a.saveXML({format:!0}).then(({xml:y})=>{p.value=y,d.value="xml",c.value=!0})},h=()=>{a.saveXML({format:!0}).then(({xml:y})=>{var C;const x=new wn(Oe.Root,function(N,O={}){const B=N.replace(/\r\n?/g,`
  256. `),H=function(X={}){const oe=Qb({},X);return eT.forEach(ne=>{On(oe[ne])&&(oe[ne]=nx[ne])}),oe}(O),q=B.length,U=new wn(Oe.Root);let V=U,te="";for(let X=0;X<q;X++){const oe=B[X];if(oe!=="<")te+=oe;else if(B[X+1]==="/"){const ne=Po(B,">",X,`Element End ${Dr}`);let I=B.substring(X+2,ne),R="";if(!H.prefixInName){const M=I.indexOf(":");~M&&(R=I.substring(0,M),I=I.substring(M+1))}if(V.prefix!==R||V.name!==I)throw new Error("End Tag is incorrect.");if(te){const M=hh(Or("",Oe.Text,te,H));M&&V.addChild(new wn(Oe.Text,V,M))}V=V.parent,te="",X=ne}else if(B[X+1]==="?"){const ne=Po(B,"?>",X,`Processing Instruction ${Dr}`),I=B.substring(X+2,ne-1);if(V)if(I.startsWith("xml ")&&I.includes("version=")&&V.type===Oe.Root){const R=new wn(Oe.Declaration,V);R.attributes=mh(I.substr(4),Oe.Declaration,H),V.addChild(R)}else V.addChild(new wn(Oe.Instruction,V,Or("",Oe.Instruction,I,H)));X=ne}else if(B.substr(X+1,3)==="!--"){const ne=Po(B,"-->",X,`Comment ${Dr}`),I=B.substring(X+4,ne-2);V&&V.addChild(new wn(Oe.Comment,V,Or("",Oe.Comment,I,H))),X=ne}else if(B.substr(X+1,8)==="!DOCTYPE"){let ne=Po(B,">",X,`Document Type ${Dr}`),I=B.substring(X+9,ne);I.includes("[")&&(ne=Po(B,"]>",X,`Document Type ${Dr}`),I=B.substring(X+9,ne)),V&&V.addChild(new wn(Oe.DocumentType,V,Or("",Oe.DocumentType,I,H))),X=ne}else if(B.substr(X+1,8)==="![CDATA["){const ne=Po(B,"]]>",X,`CDATA Section ${Dr}`),I=B.substring(X+9,ne-2);if(V&&te){const R=hh(Or("",Oe.Text,te,H));R&&V.addChild(new wn(Oe.Text,V,R))}V.addChild(new wn(Oe.CDATA,V,Or("",Oe.CDATA,I,H))),te="",X=ne}else{let ne="",I="",R=X+1;for(;R<=q;){let j=B[R];if(ne)j===ne&&(ne="");else if(j==='"'||j==="'")ne=j;else if(j===" ")j=" ";else if(j===">")break;I+=j,R++}if(R>q)throw new Error(`Element ${Dr}`);I=I.trim();const M=I.indexOf(" ");let L=I,K="";if(~M?(L=I.substr(0,M),I=I.substr(M+1)):I="",!H.prefixInName){const j=L.indexOf(":");~j&&(K=L.substring(0,j),L=L.substring(j+1))}if(V&&te){const j=hh(Or("",Oe.Text,te,H));j&&V.addChild(new wn(Oe.Text,V,j))}if(I.length&&I.lastIndexOf("/")===I.length-1){L[L.length-1]==="/"?(L=L.substr(0,L.length-1),I=""):I=I.substr(0,I.length-1);const j=new wn(Oe.Element,V);j.name=L,j.selfClosing=!0,j.prefix=K,I&&!H.ignoreAttributes&&(j.attributes=mh(I,Oe.Element,H)),V.addChild(j)}else{const j=new wn(Oe.Element,V);I&&!H.ignoreAttributes&&(j.attributes=mh(I,Oe.Element,H)),j.name=L,j.prefix=K,V.addChild(j),V=j}te="",X=R}}return U}(y));p.value=(C=x.parent)==null?void 0:C.toJSON(),d.value="json",c.value=!0})};return nr(()=>{(()=>{if(a)return;let y=document.getElementById("bpmnCanvas");console.log(y,"data"),console.log(o.keyboard,"props.keyboard"),console.log(v,"additionalModules()"),console.log(g,"moddleExtensions()"),a=new Yn({container:y,keyboard:o.keyboard?{bindTo:document}:null,additionalModules:v.value,moddleExtensions:g.value}),r("init-finished",a),(()=>{const x=a.get("eventBus");console.log(x,"EventBus"),o.events.forEach(C=>{x.on(C,function(N){let O=C.replace(/\./g,"-"),B=N?N.element:null;console.log(O,"eventName"),console.log(B,"element"),r("element-click",B,N)})}),x.on("commandStack.changed",async C=>{try{m.value=a.get("commandStack").canRedo(),f.value=a.get("commandStack").canUndo();let{xml:N}=await a.saveXML({format:!0});r("commandStack-changed",C),r("input",N),r("change",N)}catch(N){console.error(`[Process Designer Warn]: ${N.message||N}`)}}),a.on("canvas.viewbox.changed",({viewbox:C})=>{r("canvas-viewbox-changed",{viewbox:C});const{scale:N}=C;s.value=Math.floor(100*N)/100})})()})(),E(o.value)}),An(()=>{a&&a.destroy(),r("destroy",a),a=null}),(y,x)=>{const C=Jn,N=Ax,O=yx,B=vh,H=on,q=Nc,U=_h("highlight");return W(),pe("div",nT,[me("div",iT,[Mx(y.$slots,"control-header"),y.$slots["control-header"]?fe("",!0):(W(),pe(Le,{key:0},[T(B,{key:"file-control"},{default:D(()=>[T(C,{preIcon:"ep:folder-opened",title:"\u6253\u5F00\u6587\u4EF6",onClick:x[0]||(x[0]=V=>A(i).click())}),T(O,{effect:"light",placement:"bottom"},{content:D(()=>[me("div",rT,[T(N,{title:"\u4E0B\u8F7D\u4E3AXML\u6587\u4EF6",onClick:x[1]||(x[1]=V=>{_("xml")})}),x[17]||(x[17]=me("br",null,null,-1)),T(N,{title:"\u4E0B\u8F7D\u4E3ASVG\u6587\u4EF6",onClick:x[2]||(x[2]=V=>{_("svg")})}),x[18]||(x[18]=me("br",null,null,-1)),T(N,{title:"\u4E0B\u8F7D\u4E3ABPMN\u6587\u4EF6",onClick:x[3]||(x[3]=V=>{_("bpmn")})})])]),default:D(()=>[T(C,{title:"\u4E0B\u8F7D\u6587\u4EF6",preIcon:"ep:download"})]),_:1}),T(O,{effect:"light"},{content:D(()=>[T(N,{title:"\u9884\u89C8XML",onClick:l}),x[19]||(x[19]=me("br",null,null,-1)),T(N,{title:"\u9884\u89C8JSON",onClick:h})]),default:D(()=>[T(C,{preIcon:"ep:view",title:"\u6D4F\u89C8"})]),_:1}),o.simulation?(W(),re(O,{key:0,effect:"light",content:A(u)?"\u9000\u51FA\u6A21\u62DF":"\u5F00\u542F\u6A21\u62DF"},{default:D(()=>[T(C,{preIcon:"ep:cpu",title:"\u6A21\u62DF",onClick:S})]),_:1},8,["content"])):fe("",!0)]),_:1}),T(B,{key:"align-control"},{default:D(()=>[T(O,{effect:"light",content:"\u5411\u5DE6\u5BF9\u9F50"},{default:D(()=>[T(C,{preIcon:"fa:align-left",class:"align align-bottom",onClick:x[4]||(x[4]=V=>k("left"))})]),_:1}),T(O,{effect:"light",content:"\u5411\u53F3\u5BF9\u9F50"},{default:D(()=>[T(C,{preIcon:"fa:align-left",class:"align align-top",onClick:x[5]||(x[5]=V=>k("right"))})]),_:1}),T(O,{effect:"light",content:"\u5411\u4E0A\u5BF9\u9F50"},{default:D(()=>[T(C,{preIcon:"fa:align-left",class:"align align-left",onClick:x[6]||(x[6]=V=>k("top"))})]),_:1}),T(O,{effect:"light",content:"\u5411\u4E0B\u5BF9\u9F50"},{default:D(()=>[T(C,{preIcon:"fa:align-left",class:"align align-right",onClick:x[7]||(x[7]=V=>k("bottom"))})]),_:1}),T(O,{effect:"light",content:"\u6C34\u5E73\u5C45\u4E2D"},{default:D(()=>[T(C,{preIcon:"fa:align-left",class:"align align-center",onClick:x[8]||(x[8]=V=>k("center"))})]),_:1}),T(O,{effect:"light",content:"\u5782\u76F4\u5C45\u4E2D"},{default:D(()=>[T(C,{preIcon:"fa:align-left",class:"align align-middle",onClick:x[9]||(x[9]=V=>k("middle"))})]),_:1})]),_:1}),T(B,{key:"scale-control"},{default:D(()=>[T(O,{effect:"light",content:"\u7F29\u5C0F\u89C6\u56FE"},{default:D(()=>[T(C,{preIcon:"ep:zoom-out",onClick:x[10]||(x[10]=V=>((te=.1)=>{let X=Math.floor(100*s.value-100*te)/100;if(X<.2)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be less than 0.2");s.value=X,a.get("canvas").zoom(s.value)})()),disabled:A(s)<.2},null,8,["disabled"])]),_:1}),T(H,null,{default:D(()=>[ce(sn(Math.floor(10*A(s)*10)+"%"),1)]),_:1}),T(O,{effect:"light",content:"\u653E\u5927\u89C6\u56FE"},{default:D(()=>[T(C,{preIcon:"ep:zoom-in",onClick:x[11]||(x[11]=V=>((te=.1)=>{let X=Math.floor(100*s.value+100*te)/100;if(X>4)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be greater than 4");s.value=X,a.get("canvas").zoom(s.value)})()),disabled:A(s)>4},null,8,["disabled"])]),_:1}),T(O,{effect:"light",content:"\u91CD\u7F6E\u89C6\u56FE\u5E76\u5C45\u4E2D"},{default:D(()=>[T(C,{preIcon:"ep:scale-to-original",onClick:x[12]||(x[12]=V=>(s.value=1,void a.get("canvas").zoom("fit-viewport","auto")))})]),_:1})]),_:1}),T(B,{key:"stack-control"},{default:D(()=>[T(O,{effect:"light",content:"\u64A4\u9500"},{default:D(()=>[T(C,{preIcon:"ep:refresh-left",onClick:x[13]||(x[13]=V=>{a.get("commandStack").undo()}),disabled:!A(f)},null,8,["disabled"])]),_:1}),T(O,{effect:"light",content:"\u6062\u590D"},{default:D(()=>[T(C,{preIcon:"ep:refresh-right",onClick:x[14]||(x[14]=V=>{a.get("commandStack").redo()}),disabled:!A(m)},null,8,["disabled"])]),_:1}),T(O,{effect:"light",content:"\u91CD\u65B0\u7ED8\u5236"},{default:D(()=>[T(C,{preIcon:"ep:refresh",onClick:x[15]||(x[15]=V=>(m.value=!1,f.value=!1,void E(null)))})]),_:1})]),_:1})],64)),me("input",{type:"file",id:"files",ref_key:"refFile",ref:i,style:{display:"none"},accept:".xml, .bpmn",onChange:w},null,544)]),me("div",oT,[me("div",{class:"my-process-designer__canvas",ref_key:"bpmnCanvas",ref:n,id:"bpmnCanvas",style:{width:"1680px",height:"800px"}},null,512)]),T(q,{title:"\u9884\u89C8",modelValue:A(c),"onUpdate:modelValue":x[16]||(x[16]=V=>ze(c)?c.value=V:null),width:"80%",scroll:!0,"max-height":"600px"},{default:D(()=>[xi((W(),pe("div",null,[me("code",aT,sn(A(p)),1)])),[[U]])]),_:1},8,["modelValue"])])}}});kc.install=function(e){e.component(kc.name,kc)};const sT={class:"flex-col"},lT={class:"flex-col"},cT={class:"flex-col"},uT={class:"button-setting-pane"},pT={class:"button-setting-item-label"},dT={class:"button-setting-item-label"},hT=["onBlur","onUpdate:modelValue","placeholder"],mT={class:"button-setting-item-label"},fT={key:2,class:"field-setting-pane"},vT={class:"field-setting-item-label"},yT={class:"item-radio-wrap"},gT={class:"item-radio-wrap"},bT={class:"item-radio-wrap"},xT=et({name:"ElementCustomConfig4UserTask",__name:"UserTaskCustomConfig",props:{id:String,type:String},setup(e){const t=e,n=ln("prefix"),i=F(),r=F(),o=F(),a=F(),s=F(),c=F(),u=F([]),p=F(),d=F(),m=F(),f=F(),v=F(),{btnDisplayNameEdit:g,changeBtnDisplayName:E,btnDisplayNameBlurEvent:_}=function(){const te=F(),X=F([]);return{buttonsSetting:te,btnDisplayNameEdit:X,changeBtnDisplayName:oe=>{X.value[oe]=!0},btnDisplayNameBlurEvent:oe=>{X.value[oe]=!1;const ne=te.value[oe];ne.displayName=ne.displayName||kh.get(ne.id)}}}(),b=F([]),{formType:w,fieldsPermissionConfig:S,getNodeConfigFormFields:k}=Th(_i.READ),l=F({value:Ch.USER}),h=F(),y=F(),x=F(),C=()=>window==null?void 0:window.bpmnInstances,N=()=>{i.value.value=r.value,U()},O=()=>{o.value.value=a.value,c.value=u.value[0].id,s.value.value=c.value,U()},B=()=>{s.value.value=c.value,U()},H=()=>{p.value.value=d.value,U()},q=()=>{m.value.value=f.value.toString(),U()},U=()=>{const te=C().moddle.create("bpmn:ExtensionElements",{values:[...y.value,i.value,o.value,s.value,p.value,m.value,l.value,...v.value,...b.value]});C().modeling.updateProperties(Te(x.value),{extensionElements:te})};qe(()=>t.id,te=>{te&&te.length&&it(()=>{(()=>{var X,oe,ne,I,R,M,L,K,j,G,J,Y,he,be,je,De,Mt;if(x.value=C().bpmnElement,u.value=function(ie,Ie){const Sn=Ie.get("elementRegistry"),yi=Sn.filter(jn=>jn.type==="bpmn:SequenceFlow"),nt=new Set,Ot=new Set,Ln=Sn.get(ie);return Ln&&function jn(jr){Ot.has(jr)||(Ot.add(jr),yi.filter(Rc=>Rc.target===jr).forEach(Rc=>{const Mc=Rc.source;(function(fx){return fx.type==="bpmn:StartEvent"})(Mc)||(nt.add(Mc.businessObject),jn(Mc))}))}(Ln),Array.from(nt)}(x.value.id,C().modeler),h.value=((X=x.value.businessObject)==null?void 0:X.extensionElements)??C().moddle.create("bpmn:ExtensionElements",{values:[]}),l.value=((ne=(oe=h.value.values)==null?void 0:oe.filter(ie=>ie.$type===`${n}:ApproveType`))==null?void 0:ne[0])||C().moddle.create(`${n}:ApproveType`,{value:Ch.USER}),i.value=((R=(I=h.value.values)==null?void 0:I.filter(ie=>ie.$type===`${n}:AssignStartUserHandlerType`))==null?void 0:R[0])||C().moddle.create(`${n}:AssignStartUserHandlerType`,{value:1}),r.value=i.value.value,o.value=((L=(M=h.value.values)==null?void 0:M.filter(ie=>ie.$type===`${n}:RejectHandlerType`))==null?void 0:L[0])||C().moddle.create(`${n}:RejectHandlerType`,{value:1}),a.value=o.value.value,s.value=((j=(K=h.value.values)==null?void 0:K.filter(ie=>ie.$type===`${n}:RejectReturnTaskId`))==null?void 0:j[0])||C().moddle.create(`${n}:RejectReturnTaskId`,{value:""}),c.value=s.value.value,p.value=((J=(G=h.value.values)==null?void 0:G.filter(ie=>ie.$type===`${n}:AssignEmptyHandlerType`))==null?void 0:J[0])||C().moddle.create(`${n}:AssignEmptyHandlerType`,{value:1}),d.value=p.value.value,m.value=((he=(Y=h.value.values)==null?void 0:Y.filter(ie=>ie.$type===`${n}:AssignEmptyUserIds`))==null?void 0:he[0])||C().moddle.create(`${n}:AssignEmptyUserIds`,{value:""}),f.value=(be=m.value.value)==null?void 0:be.split(",").map(ie=>{let Ie=Number(ie);return Ie>Number.MAX_SAFE_INTEGER||Ie<-Number.MAX_SAFE_INTEGER?ie:Ie}),v.value=(je=h.value.values)==null?void 0:je.filter(ie=>ie.$type===`${n}:ButtonsSetting`),v.value.length===0&&Fx.forEach(ie=>{v.value.push(C().moddle.create(`${n}:ButtonsSetting`,{"flowable:id":ie.id,"flowable:displayName":ie.displayName,"flowable:enable":ie.enable}))}),w.value===10){const ie=(De=h.value.values)==null?void 0:De.filter(Ie=>Ie.$type===`${n}:FieldsPermission`);b.value=[],k(),S.value=S.value.slice(1),S.value.forEach(Ie=>{var Sn;Ie.permission=((Sn=ie==null?void 0:ie.find(yi=>yi.field===Ie.field))==null?void 0:Sn.permission)??"1",b.value.push(C().moddle.create(`${n}:FieldsPermission`,Ie))})}y.value=((Mt=h.value.values)==null?void 0:Mt.filter(ie=>ie.$type!==`${n}:AssignStartUserHandlerType`&&ie.$type!==`${n}:RejectHandlerType`&&ie.$type!==`${n}:RejectReturnTaskId`&&ie.$type!==`${n}:AssignEmptyHandlerType`&&ie.$type!==`${n}:AssignEmptyUserIds`&&ie.$type!==`${n}:ButtonsSetting`&&ie.$type!==`${n}:FieldsPermission`&&ie.$type!==`${n}:ApproveType`))??[],U()})()})},{immediate:!0});const V=F([]);return nr(async()=>{V.value=await Ah()}),(te,X)=>{const oe=$r,ne=yh,I=Ic,R=Nt,M=Cn,L=kn,K=Mo,j=on,G=Bc,J=_h("mountedFocus");return W(),pe("div",null,[T(oe,{"content-position":"left"},{default:D(()=>X[6]||(X[6]=[ce("\u5BA1\u6279\u7C7B\u578B")])),_:1}),T(R,{prop:"approveType"},{default:D(()=>[T(I,{modelValue:A(l).value,"onUpdate:modelValue":X[0]||(X[0]=Y=>A(l).value=Y)},{default:D(()=>[(W(!0),pe(Le,null,We(A(Dx),(Y,he)=>(W(),re(ne,{key:he,value:Y.value,label:Y.value},{default:D(()=>[ce(sn(Y.label),1)]),_:2},1032,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),T(oe,{"content-position":"left"},{default:D(()=>X[7]||(X[7]=[ce("\u5BA1\u6279\u4EBA\u62D2\u7EDD\u65F6")])),_:1}),T(R,{prop:"rejectHandlerType"},{default:D(()=>[T(I,{modelValue:A(a),"onUpdate:modelValue":X[1]||(X[1]=Y=>ze(a)?a.value=Y:null),disabled:A(u).length===0,onChange:O},{default:D(()=>[me("div",sT,[(W(!0),pe(Le,null,We(A(Ox),(Y,he)=>(W(),pe("div",{key:he},[(W(),re(ne,{key:Y.value,value:Y.value,label:Y.label},null,8,["value","label"]))]))),128))])]),_:1},8,["modelValue","disabled"])]),_:1}),A(a)==A(Lx).RETURN_USER_TASK?(W(),re(R,{key:0,label:"\u9A73\u56DE\u8282\u70B9",prop:"returnNodeId"},{default:D(()=>[T(L,{modelValue:A(c),"onUpdate:modelValue":X[2]||(X[2]=Y=>ze(c)?c.value=Y:null),clearable:"",style:{width:"100%"},onChange:B},{default:D(()=>[(W(!0),pe(Le,null,We(A(u),Y=>(W(),re(M,{key:Y.id,label:Y.name,value:Y.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):fe("",!0),T(oe,{"content-position":"left"},{default:D(()=>X[8]||(X[8]=[ce("\u5BA1\u6279\u4EBA\u4E3A\u7A7A\u65F6")])),_:1}),T(R,{prop:"assignEmptyHandlerType"},{default:D(()=>[T(I,{modelValue:A(d),"onUpdate:modelValue":X[3]||(X[3]=Y=>ze(d)?d.value=Y:null),onChange:H},{default:D(()=>[me("div",lT,[(W(!0),pe(Le,null,We(A(jx),(Y,he)=>(W(),pe("div",{key:he},[(W(),re(ne,{key:Y.value,value:Y.value,label:Y.label},null,8,["value","label"]))]))),128))])]),_:1},8,["modelValue"])]),_:1}),A(d)==A(Vx).ASSIGN_USER?(W(),re(R,{key:1,label:"\u6307\u5B9A\u7528\u6237",prop:"assignEmptyHandlerUserIds",span:"24"},{default:D(()=>[T(L,{modelValue:A(f),"onUpdate:modelValue":X[4]||(X[4]=Y=>ze(f)?f.value=Y:null),clearable:"",multiple:"",style:{width:"100%"},onChange:q},{default:D(()=>[(W(!0),pe(Le,null,We(A(V),Y=>(W(),re(M,{key:Y.id,label:Y.nickname,value:Y.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):fe("",!0),T(oe,{"content-position":"left"},{default:D(()=>X[9]||(X[9]=[ce("\u5BA1\u6279\u4EBA\u4E0E\u63D0\u4EA4\u4EBA\u4E3A\u540C\u4E00\u4EBA\u65F6")])),_:1}),T(I,{modelValue:A(r),"onUpdate:modelValue":X[5]||(X[5]=Y=>ze(r)?r.value=Y:null),onChange:N},{default:D(()=>[me("div",cT,[(W(!0),pe(Le,null,We(A($x),(Y,he)=>(W(),pe("div",{key:he},[(W(),re(ne,{key:Y.value,value:Y.value,label:Y.label},null,8,["value","label"]))]))),128))])]),_:1},8,["modelValue"]),T(oe,{"content-position":"left"},{default:D(()=>X[10]||(X[10]=[ce("\u64CD\u4F5C\u6309\u94AE")])),_:1}),me("div",uT,[X[11]||(X[11]=me("div",{class:"button-setting-title"},[me("div",{class:"button-title-label"},"\u64CD\u4F5C\u6309\u94AE"),me("div",{class:"pl-4 button-title-label"},"\u663E\u793A\u540D\u79F0"),me("div",{class:"button-title-label"},"\u542F\u7528")],-1)),(W(!0),pe(Le,null,We(A(v),(Y,he)=>(W(),pe("div",{class:"button-setting-item",key:he},[me("div",pT,sn(A(kh).get(Y.id)),1),me("div",dT,[A(g)[he]?xi((W(),pe("input",{key:0,type:"text",class:"editable-title-input",onBlur:be=>A(_)(he),"onUpdate:modelValue":be=>Y.displayName=be,placeholder:Y.displayName},null,40,hT)),[[J],[Nx,Y.displayName]]):(W(),re(j,{key:1,text:"",onClick:be=>A(E)(he)},{default:D(()=>[ce(sn(Y.displayName)+" \xA0",1),T(K,{icon:"ep:edit"})]),_:2},1032,["onClick"]))]),me("div",mT,[T(G,{modelValue:Y.enable,"onUpdate:modelValue":be=>Y.enable=be},null,8,["modelValue","onUpdate:modelValue"])])]))),128))]),T(oe,{"content-position":"left"},{default:D(()=>X[12]||(X[12]=[ce("\u5B57\u6BB5\u6743\u9650")])),_:1}),A(w)===10?(W(),pe("div",fT,[X[16]||(X[16]=Ix('<div class="field-permit-title" data-v-01a7a7f9><div class="setting-title-label first-title" data-v-01a7a7f9> \u5B57\u6BB5\u540D\u79F0 </div><div class="other-titles" data-v-01a7a7f9><span class="setting-title-label" data-v-01a7a7f9>\u53EA\u8BFB</span><span class="setting-title-label" data-v-01a7a7f9>\u53EF\u7F16\u8F91</span><span class="setting-title-label" data-v-01a7a7f9>\u9690\u85CF</span></div></div>',1)),(W(!0),pe(Le,null,We(A(b),(Y,he)=>(W(),pe("div",{class:"field-setting-item",key:he},[me("div",vT,sn(Y.title),1),T(I,{class:"field-setting-item-group",modelValue:Y.permission,"onUpdate:modelValue":be=>Y.permission=be},{default:D(()=>[me("div",yT,[T(ne,{value:A(_i).READ,size:"large",label:A(_i).READ},{default:D(()=>X[13]||(X[13]=[me("span",null,null,-1)])),_:1},8,["value","label"])]),me("div",gT,[T(ne,{value:A(_i).WRITE,size:"large",label:A(_i).WRITE},{default:D(()=>X[14]||(X[14]=[me("span",null,null,-1)])),_:1},8,["value","label"])]),me("div",bT,[T(ne,{value:A(_i).NONE,size:"large",label:A(_i).NONE},{default:D(()=>X[15]||(X[15]=[me("span",null,null,-1)])),_:1},8,["value","label"])])]),_:2},1032,["modelValue","onUpdate:modelValue"])]))),128))])):fe("",!0)])}}}),_T=gx(xT,[["__scopeId","data-v-01a7a7f9"]]),ET=et({name:"ElementCustomConfig4BoundaryEventTimer",__name:"BoundaryEventTimer",props:{id:String,type:String},setup(e){const t=e,n=ln("prefix"),i=F(),r=()=>window==null?void 0:window.bpmnInstances,o=F(!1),a=F(),s=F({value:void 0}),c=F(),u=F(6),p=F(ir.HOUR),d=F(1),m=F(),f=F(),v=F([]),g=F(),E=l=>{o.value=l,l?(a.value=r().moddle.create(`${n}:BoundaryEventType`,{value:1}),v.value.push(a.value),s.value=r().moddle.create(`${n}:TimeoutHandlerType`,{value:1}),v.value.push(s.value),u.value=6,p.value=2,d.value=1,c.value=r().moddle.create("bpmn:Expression",{body:"PT6H"}),g.value.timeDuration=c.value):(v.value=[],delete g.value.timeDuration,delete g.value.timeCycle),k()},_=()=>{d.value=1,k(),w()},b=()=>{p.value===ir.MINUTE&&(u.value=60),p.value===ir.HOUR&&(u.value=6),p.value===ir.DAY&&(u.value=1),w()},w=()=>{d.value>1?(c.value.body="R"+d.value+"/"+S(),g.value.timeCycle||(delete g.value.timeDuration,g.value.timeCycle=c.value)):(c.value.body=S(),g.value.timeDuration||(delete g.value.timeCycle,g.value.timeDuration=c.value))},S=()=>{let l="PT";return p.value===ir.MINUTE&&(l+=u.value+"M"),p.value===ir.HOUR&&(l+=u.value+"H"),p.value===ir.DAY&&(l+=u.value+"D"),l},k=()=>{const l=r().moddle.create("bpmn:ExtensionElements",{values:[...f.value,...v.value]});r().modeling.updateProperties(Te(i.value),{extensionElements:l})};return qe(()=>t.id,l=>{l&&l.length&&it(()=>{(()=>{var h,y,x,C,N,O;if(i.value=r().bpmnElement,g.value=i.value.businessObject.eventDefinitions[0],m.value=((h=i.value.businessObject)==null?void 0:h.extensionElements)??r().moddle.create("bpmn:ExtensionElements",{values:[]}),a.value=(x=(y=m.value.values)==null?void 0:y.filter(B=>B.$type===`${n}:BoundaryEventType`))==null?void 0:x[0],a.value&&a.value.value===1&&(o.value=!0,v.value.push(a.value)),s.value=(N=(C=m.value.values)==null?void 0:C.filter(B=>B.$type===`${n}:TimeoutHandlerType`))==null?void 0:N[0],s.value){if(v.value.push(s.value),g.value.timeCycle){const B=g.value.timeCycle.body,H=B.split("/")[0],q=B.split("/")[1];console.log(H),d.value=parseInt(H.slice(1)),u.value=parseInt(q.slice(2,q.length-1)),p.value=Ph(q.slice(q.length-1)),c.value=g.value.timeCycle}if(g.value.timeDuration){const B=g.value.timeDuration.body;u.value=parseInt(B.slice(2,B.length-1)),p.value=Ph(B.slice(B.length-1)),c.value=g.value.timeDuration}}f.value=((O=m.value.values)==null?void 0:O.filter(B=>B.$type!==`${n}:BoundaryEventType`&&B.$type!==`${n}:TimeoutHandlerType`))??[]})()})},{immediate:!0}),(l,h)=>{const y=$r,x=Bc,C=Nt,N=bx,O=Ic,B=gh,H=Cn,q=kn;return W(),pe("div",null,[T(y,{"content-position":"left"},{default:D(()=>h[7]||(h[7]=[ce("\u5BA1\u6279\u4EBA\u8D85\u65F6\u672A\u5904\u7406\u65F6")])),_:1}),T(C,{label:"\u542F\u7528\u5F00\u5173",prop:"timeoutHandlerEnable"},{default:D(()=>[T(x,{modelValue:A(o),"onUpdate:modelValue":h[0]||(h[0]=U=>ze(o)?o.value=U:null),"active-text":"\u5F00\u542F","inactive-text":"\u5173\u95ED",onChange:E},null,8,["modelValue"])]),_:1}),A(o)?(W(),re(C,{key:0,label:"\u6267\u884C\u52A8\u4F5C",prop:"timeoutHandlerType"},{default:D(()=>[T(O,{modelValue:A(s).value,"onUpdate:modelValue":h[1]||(h[1]=U=>A(s).value=U),onChange:_},{default:D(()=>[(W(!0),pe(Le,null,We(A(zx),U=>(W(),re(N,{key:U.value,value:U.value,label:U.label},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1})):fe("",!0),A(o)?(W(),re(C,{key:1,label:"\u8D85\u65F6\u65F6\u95F4\u8BBE\u7F6E"},{default:D(()=>[h[8]||(h[8]=me("span",{class:"mr-2"},"\u5F53\u8D85\u8FC7",-1)),T(C,{prop:"timeDuration"},{default:D(()=>[T(B,{class:"mr-2",style:{width:"100px"},modelValue:A(u),"onUpdate:modelValue":h[2]||(h[2]=U=>ze(u)?u.value=U:null),min:1,"controls-position":"right",onChange:h[3]||(h[3]=()=>w())},null,8,["modelValue"])]),_:1}),T(q,{modelValue:A(p),"onUpdate:modelValue":h[4]||(h[4]=U=>ze(p)?p.value=U:null),class:"mr-2",style:{width:"100px"},onChange:b},{default:D(()=>[(W(!0),pe(Le,null,We(A(Ux),U=>(W(),re(H,{key:U.value,label:U.label,value:U.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),h[9]||(h[9]=ce(" \u672A\u5904\u7406 "))]),_:1})):fe("",!0),A(o)&&A(s).value===1?(W(),re(C,{key:2,label:"\u6700\u5927\u63D0\u9192\u6B21\u6570",prop:"maxRemindCount"},{default:D(()=>[T(B,{modelValue:A(d),"onUpdate:modelValue":h[5]||(h[5]=U=>ze(d)?d.value=U:null),min:1,max:10,onChange:h[6]||(h[6]=()=>w())},null,8,["modelValue"])]),_:1})):fe("",!0)])}}}),wT={UserTask:{name:"\u7528\u6237\u4EFB\u52A1",componet:_T},BoundaryEventTimerEventDefinition:{name:"\u5B9A\u65F6\u8FB9\u754C\u4E8B\u4EF6(\u975E\u4E2D\u65AD)",componet:ET}},ST={class:"panel-tab__content"},CT=et({name:"ElementCustomConfig",__name:"ElementCustomConfig",props:{id:String,type:String,businessObject:{type:Object,default:()=>{}}},setup(e){const t=e,n=F(null);return qe(()=>t.businessObject,()=>{var i,r;if(t.type&&t.businessObject){let o=t.type;t.businessObject.eventDefinitions&&(o+=((i=t.businessObject.eventDefinitions[0])==null?void 0:i.$type.split(":")[1])||""),n.value=(r=wT[o])==null?void 0:r.componet}},{immediate:!0}),(i,r)=>(W(),pe("div",ST,[(W(),re(Sh(A(n)),Eh(wh(i.$props)),null,16))]))}}),kT={class:"panel-tab__content"},AT=et({name:"ElementForm",__name:"ElementForm",props:{id:String,type:String},setup(e){const t=e,n=ln("prefix");ln("width");const i=F(""),r=F("");F("");const o=F([]);F({}),F({long:"\u957F\u6574\u578B",string:"\u5B57\u7B26\u4E32",boolean:"\u5E03\u5C14\u7C7B",date:"\u65E5\u671F\u7C7B",enum:"\u679A\u4E3E\u7C7B",custom:"\u81EA\u5B9A\u4E49\u7C7B\u578B"}),F(-1),F(-1),F(!1),F(!1),F({}),F(""),F([]),F([]),F([]);const a=F(),s=F(),c=F(),u=F(),p=()=>window==null?void 0:window.bpmnInstances,d=()=>{p().modeling.updateProperties(Te(a.value),{formKey:i.value})},m=F([]);return nr(async()=>{m.value=await qx()}),qe(()=>t.id,f=>{f&&f.length&&it(()=>{var v;a.value=p().bpmnElement,i.value=a.value.businessObject.formKey,s.value=a.value.businessObject.get("extensionElements")||p().moddle.create("bpmn:ExtensionElements",{values:[]}),c.value=((v=s.value.values.filter(g=>g.$type===`${n}:FormData`))==null?void 0:v[0])||p().moddle.create(`${n}:FormData`,{fields:[]}),r.value=c.value.businessKey,u.value=s.value.values.filter(g=>g.$type!==`${n}:FormData`),o.value=JSON.parse(JSON.stringify(c.value.fields||[])),(()=>{const g=p().moddle.create("bpmn:ExtensionElements",{values:u.value.concat(c.value)});p().modeling.updateProperties(Te(a.value),{extensionElements:g})})()})},{immediate:!0}),(f,v)=>{const g=Cn,E=kn,_=Nt,b=an;return W(),pe("div",kT,[T(b,{"label-width":"80px"},{default:D(()=>[T(_,{label:"\u6D41\u7A0B\u8868\u5355"},{default:D(()=>[T(E,{modelValue:A(i),"onUpdate:modelValue":v[0]||(v[0]=w=>ze(i)?i.value=w:null),clearable:"",onChange:d},{default:D(()=>[(W(!0),pe(Le,null,We(A(m),w=>(W(),re(g,{key:w.id,label:w.name,value:w.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})])}}}),TT={class:"panel-tab__content"},PT={key:0},RT={key:1},MT=et({name:"ElementBaseInfo",__name:"ElementBaseInfo",props:{businessObject:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}}},setup(e){const t=e,n=F({}),i=F(),r=F({}),o=jc({id:[{required:!0,message:"\u6D41\u7A0B\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],name:[{required:!0,message:"\u6D41\u7A0B\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),a=()=>window==null?void 0:window.bpmnInstances,s=p=>{p&&(p.match(/[a-zA-Z_][\-_.0-9a-zA-Z$]*/)?(console.log("key \u6EE1\u8DB3 XML NCName \u89C4\u5219\uFF0C\u6240\u4EE5\u8FDB\u884C\u8D4B\u503C"),r.value.id=p,setTimeout(()=>{u("id")},100)):console.log("key \u4E0D\u6EE1\u8DB3 XML NCName \u89C4\u5219\uFF0C\u6240\u4EE5\u4E0D\u8FDB\u884C\u8D4B\u503C"))},c=p=>{console.log(r,"elementBaseInfo"),p&&(r.value.name=p,setTimeout(()=>{u("name")},100))},u=p=>{console.log(p,"key");const d=Object.create(null);d[p]=r.value[p],n.value={...r.value,...n.value},p==="id"?(console.log(window,"window"),console.log(i.value,"bpmnElement"),console.log(Te(i.value),"bpmnElement"),a().modeling.updateProperties(Te(i.value),{id:r.value[p],di:{id:`${r.value[p]}_di`}})):(console.log(d,"attrObj"),a().modeling.updateProperties(Te(i.value),d))};return qe(()=>t.businessObject,p=>{var d;p&&(console.log(window,"window"),console.log(i.value,"bpmnElement"),i.value=(d=a())==null?void 0:d.bpmnElement,r.value=i.value.businessObject,n.value.type=i.value.businessObject.$type)}),qe(()=>{var p;return(p=t.model)==null?void 0:p.key},p=>{p&&(s(t.model.key),c(t.model.name))}),An(()=>{i.value=null}),(p,d)=>{const m=Jt,f=Nt,v=an;return W(),pe("div",TT,[T(v,{"label-width":"90px",model:A(n),rules:A(o)},{default:D(()=>[A(n).type=="bpmn:Process"?(W(),pe("div",PT,[T(f,{label:"\u6D41\u7A0B\u6807\u8BC6",prop:"id"},{default:D(()=>[T(m,{modelValue:A(n).id,"onUpdate:modelValue":d[0]||(d[0]=g=>A(n).id=g),placeholder:"\u8BF7\u8F93\u5165\u6D41\u6807\u6807\u8BC6",disabled:A(n).id!==void 0&&A(n).id.length>0,onChange:s},null,8,["modelValue","disabled"])]),_:1}),T(f,{label:"\u6D41\u7A0B\u540D\u79F0",prop:"name"},{default:D(()=>[T(m,{modelValue:A(n).name,"onUpdate:modelValue":d[1]||(d[1]=g=>A(n).name=g),placeholder:"\u8BF7\u8F93\u5165\u6D41\u7A0B\u540D\u79F0",clearable:"",onChange:c},null,8,["modelValue"])]),_:1})])):(W(),pe("div",RT,[T(f,{label:"ID"},{default:D(()=>[T(m,{modelValue:A(r).id,"onUpdate:modelValue":d[2]||(d[2]=g=>A(r).id=g),clearable:"",onChange:d[3]||(d[3]=g=>u("id"))},null,8,["modelValue"])]),_:1}),T(f,{label:"\u540D\u79F0"},{default:D(()=>[T(m,{modelValue:A(r).name,"onUpdate:modelValue":d[4]||(d[4]=g=>A(r).name=g),clearable:"",onChange:d[5]||(d[5]=g=>u("name"))},null,8,["modelValue"])]),_:1})]))]),_:1},8,["model","rules"])])}}}),NT={class:"panel-tab__content"},IT={class:"element-property input-property"},BT={class:"element-property__value"},DT=et({name:"ElementOtherConfig",__name:"ElementOtherConfig",props:{id:String},setup(e){const t=e,n=F(""),i=F(),r=()=>window.bpmnInstances,o=()=>{i.value&&i.value.id===t.id||(i.value=r().elementRegistry.get(t.id));const a=r().bpmnFactory.create("bpmn:Documentation",{text:n.value});r().modeling.updateProperties(Te(i.value),{documentation:[a]})};return An(()=>{i.value=null}),qe(()=>t.id,a=>{a&&a.length?it(()=>{var c;const s=(c=r().bpmnElement.businessObject)==null?void 0:c.documentation;n.value=s&&s.length?s[0].text:""}):n.value=""},{immediate:!0}),(a,s)=>{const c=Jt;return W(),pe("div",NT,[me("div",IT,[s[1]||(s[1]=me("div",{class:"element-property__label"},"\u5143\u7D20\u6587\u6863\uFF1A",-1)),me("div",BT,[T(c,{type:"textarea",modelValue:A(n),"onUpdate:modelValue":s[0]||(s[0]=u=>ze(n)?n.value=u:null),resize:"vertical",autosize:{minRows:2,maxRows:4},onInput:o,onBlur:o},null,8,["modelValue"])])])])}}}),rx=et({name:"ProcessExpressionDialog",__name:"ProcessExpressionDialog",emits:["success"],setup(e,{expose:t,emit:n}){const i=F(!1),r=F(!0),o=F([]),a=F(0),s=jc({pageNo:1,pageSize:10,type:"",status:Nh.ENABLE});t({open:p=>{s.pageNo=1,s.type=p,c(),i.value=!0}});const c=async()=>{r.value=!0;try{const p=await t_.getProcessExpressionPage(s);o.value=p.list,a.value=p.total}finally{r.value=!1}},u=n;return(p,d)=>{const m=gi,f=on,v=bi,g=Mh,E=Rh,_=Nc,b=bh;return W(),re(_,{title:"\u8BF7\u9009\u62E9\u8868\u8FBE\u5F0F",modelValue:A(i),"onUpdate:modelValue":d[2]||(d[2]=w=>ze(i)?i.value=w:null),width:"1024px"},{default:D(()=>[T(E,null,{default:D(()=>[xi((W(),re(v,{data:A(o),stripe:!0,"show-overflow-tooltip":!0},{default:D(()=>[T(m,{label:"\u540D\u5B57",align:"center",prop:"name"}),T(m,{label:"\u8868\u8FBE\u5F0F",align:"center",prop:"expression"}),T(m,{label:"\u64CD\u4F5C",align:"center"},{default:D(w=>[T(f,{link:"",type:"primary",onClick:S=>(async k=>{i.value=!1,u("select",k)})(w.row)},{default:D(()=>d[3]||(d[3]=[ce(" \u9009\u62E9 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[b,A(r)]]),T(g,{total:A(a),page:A(s).pageNo,"onUpdate:page":d[0]||(d[0]=w=>A(s).pageNo=w),limit:A(s).pageSize,"onUpdate:limit":d[1]||(d[1]=w=>A(s).pageSize=w),onPagination:c},null,8,["total","page","limit"])]),_:1})]),_:1},8,["modelValue"])}}}),OT=et({name:"UserTask",__name:"UserTask",props:{id:String,type:String},setup(e){const t=e,n=ln("prefix"),i=F({candidateStrategy:void 0,candidateParam:[]}),r=F(),o=()=>window==null?void 0:window.bpmnInstances,a=F([]),s=F(),c=F([]),u=F([]),p=F([]),{formFieldOptions:d}=Th(_i.READ),m=Fr(()=>d.filter(h=>h.type==="UserSelect")),f=Fr(()=>d.filter(h=>h.type==="DeptSelect")),v=F(1),g=Fr(()=>{let h="\u90E8\u95E8\u8D1F\u8D23\u4EBA\u6765\u6E90";return i.value.candidateStrategy==Ue.MULTI_LEVEL_DEPT_LEADER?h+="(\u6307\u5B9A\u90E8\u95E8\u5411\u4E0A)":i.value.candidateStrategy==Ue.FORM_DEPT_LEADER?h+="(\u8868\u5355\u5185\u90E8\u95E8\u5411\u4E0A)":h+="(\u53D1\u8D77\u4EBA\u90E8\u95E8\u5411\u4E0A)",h}),E=F(),_=()=>{i.value.candidateParam=[],v.value=1,i.value.candidateStrategy===Ue.FORM_USER&&(!m.value||m.value.length<=1)&&(i.value.candidateStrategy=Ue.START_USER),b()},b=()=>{let h=i.value.candidateParam instanceof Array?i.value.candidateParam.join(","):i.value.candidateParam;i.value.candidateStrategy!=Ue.MULTI_LEVEL_DEPT_LEADER&&i.value.candidateStrategy!=Ue.FORM_DEPT_LEADER||(h+="|"+v.value),i.value.candidateStrategy!=Ue.START_USER_DEPT_LEADER&&i.value.candidateStrategy!=Ue.START_USER_MULTI_LEVEL_DEPT_LEADER||(h=v.value+"");const y=o().moddle.create("bpmn:ExtensionElements",{values:[...E.value,o().moddle.create(`${n}:CandidateStrategy`,{value:i.value.candidateStrategy}),o().moddle.create(`${n}:CandidateParam`,{value:h})]});o().modeling.updateProperties(Te(r.value),{extensionElements:y})},w=F(),S=async()=>{w.value.open()},k=h=>{i.value.candidateParam=[h.expression],b()},l=h=>{h==="PROCESS_START_USER_ID"&&(i.value.candidateParam=[],i.value.candidateStrategy=Ue.START_USER),b()};return qe(()=>t.id,()=>{r.value=o().bpmnElement,it(()=>{(()=>{var C,N,O,B,H,q,U;const h=r.value.businessObject;if(!h)return;const y=(h==null?void 0:h.extensionElements)??o().moddle.create("bpmn:ExtensionElements",{values:[]});i.value.candidateStrategy=(O=(N=(C=y.values)==null?void 0:C.filter(V=>V.$type===`${n}:CandidateStrategy`))==null?void 0:N[0])==null?void 0:O.value;const x=(q=(H=(B=y.values)==null?void 0:B.filter(V=>V.$type===`${n}:CandidateParam`))==null?void 0:H[0])==null?void 0:q.value;if(x&&x.length>0)if(i.value.candidateStrategy===Ue.EXPRESSION)i.value.candidateParam=[x];else if(i.value.candidateStrategy==Ue.MULTI_LEVEL_DEPT_LEADER){const[V,te]=x.split("|");i.value.candidateParam=V.split(",").map(X=>{const oe=Number(X);return isNaN(oe)?X:oe}),v.value=Number(te)||1}else if(i.value.candidateStrategy==Ue.START_USER_DEPT_LEADER||i.value.candidateStrategy==Ue.START_USER_MULTI_LEVEL_DEPT_LEADER){const V=Number(x);i.value.candidateParam=[V],v.value=V}else if(i.value.candidateStrategy==Ue.FORM_DEPT_LEADER){const[V,te]=x.split("|");i.value.candidateParam=[V],v.value=Number(te)||1}else i.value.candidateParam=x.split(",").map(V=>{const te=Number(V);return isNaN(te)?V:te});else i.value.candidateParam=[];E.value=((U=y.values)==null?void 0:U.filter(V=>V.$type!==`${n}:CandidateStrategy`&&V.$type!==`${n}:CandidateParam`))??[]})()})},{immediate:!0}),nr(async()=>{a.value=await Jx();const h=await Zx();s.value=Xx(h,"id"),c.value=await Qx(),u.value=await Ah(),p.value=await e_()}),An(()=>{r.value=null}),(h,y)=>{const x=Cn,C=kn,N=Nt,O=Kx,B=Jt,H=Jn,q=an;return W(),re(q,{"label-width":"120px"},{default:D(()=>[T(N,{label:"\u89C4\u5219\u7C7B\u578B",prop:"candidateStrategy"},{default:D(()=>[T(C,{modelValue:A(i).candidateStrategy,"onUpdate:modelValue":y[0]||(y[0]=U=>A(i).candidateStrategy=U),clearable:"",style:{width:"100%"},onChange:_},{default:D(()=>[(W(!0),pe(Le,null,We(A(Hx),(U,V)=>(W(),re(x,{key:V,label:U.label,value:U.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),A(i).candidateStrategy==A(Ue).ROLE?(W(),re(N,{key:0,label:"\u6307\u5B9A\u89D2\u8272",prop:"candidateParam"},{default:D(()=>[T(C,{modelValue:A(i).candidateParam,"onUpdate:modelValue":y[1]||(y[1]=U=>A(i).candidateParam=U),clearable:"",multiple:"",style:{width:"100%"},onChange:b},{default:D(()=>[(W(!0),pe(Le,null,We(A(a),U=>(W(),re(x,{key:U.id,label:U.name,value:U.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):fe("",!0),A(i).candidateStrategy==A(Ue).DEPT_MEMBER||A(i).candidateStrategy==A(Ue).DEPT_LEADER||A(i).candidateStrategy==A(Ue).MULTI_LEVEL_DEPT_LEADER?(W(),re(N,{key:1,label:"\u6307\u5B9A\u90E8\u95E8",prop:"candidateParam",span:"24"},{default:D(()=>[T(O,{ref:"treeRef",modelValue:A(i).candidateParam,"onUpdate:modelValue":y[2]||(y[2]=U=>A(i).candidateParam=U),data:A(s),props:A(Yx),"empty-text":"\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u7A0D\u540E",multiple:"","node-key":"id","show-checkbox":"",onChange:b},null,8,["modelValue","data","props"])]),_:1})):fe("",!0),A(i).candidateStrategy==A(Ue).POST?(W(),re(N,{key:2,label:"\u6307\u5B9A\u5C97\u4F4D",prop:"candidateParam",span:"24"},{default:D(()=>[T(C,{modelValue:A(i).candidateParam,"onUpdate:modelValue":y[3]||(y[3]=U=>A(i).candidateParam=U),clearable:"",multiple:"",style:{width:"100%"},onChange:b},{default:D(()=>[(W(!0),pe(Le,null,We(A(c),U=>(W(),re(x,{key:U.id,label:U.name,value:U.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):fe("",!0),A(i).candidateStrategy==A(Ue).USER?(W(),re(N,{key:3,label:"\u6307\u5B9A\u7528\u6237",prop:"candidateParam",span:"24"},{default:D(()=>[T(C,{modelValue:A(i).candidateParam,"onUpdate:modelValue":y[4]||(y[4]=U=>A(i).candidateParam=U),clearable:"",multiple:"",style:{width:"100%"},onChange:b},{default:D(()=>[(W(!0),pe(Le,null,We(A(u),U=>(W(),re(x,{key:U.id,label:U.nickname,value:U.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):fe("",!0),A(i).candidateStrategy===A(Ue).USER_GROUP?(W(),re(N,{key:4,label:"\u6307\u5B9A\u7528\u6237\u7EC4",prop:"candidateParam"},{default:D(()=>[T(C,{modelValue:A(i).candidateParam,"onUpdate:modelValue":y[5]||(y[5]=U=>A(i).candidateParam=U),clearable:"",multiple:"",style:{width:"100%"},onChange:b},{default:D(()=>[(W(!0),pe(Le,null,We(A(p),U=>(W(),re(x,{key:U.id,label:U.name,value:U.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):fe("",!0),A(i).candidateStrategy===A(Ue).FORM_USER?(W(),re(N,{key:5,label:"\u8868\u5355\u5185\u7528\u6237\u5B57\u6BB5",prop:"formUser"},{default:D(()=>[T(C,{modelValue:A(i).candidateParam,"onUpdate:modelValue":y[6]||(y[6]=U=>A(i).candidateParam=U),clearable:"",style:{width:"100%"},onChange:l},{default:D(()=>[(W(!0),pe(Le,null,We(A(m),(U,V)=>(W(),re(x,{key:V,label:U.title,value:U.field,disabled:!U.required},null,8,["label","value","disabled"]))),128))]),_:1},8,["modelValue"])]),_:1})):fe("",!0),A(i).candidateStrategy===A(Ue).FORM_DEPT_LEADER?(W(),re(N,{key:6,label:"\u8868\u5355\u5185\u90E8\u95E8\u5B57\u6BB5",prop:"formDept"},{default:D(()=>[T(C,{modelValue:A(i).candidateParam,"onUpdate:modelValue":y[7]||(y[7]=U=>A(i).candidateParam=U),clearable:"",style:{width:"100%"},onChange:b},{default:D(()=>[(W(!0),pe(Le,null,We(A(f),(U,V)=>(W(),re(x,{key:V,label:U.title,value:U.field,disabled:!U.required},null,8,["label","value","disabled"]))),128))]),_:1},8,["modelValue"])]),_:1})):fe("",!0),A(i).candidateStrategy==A(Ue).MULTI_LEVEL_DEPT_LEADER||A(i).candidateStrategy==A(Ue).START_USER_DEPT_LEADER||A(i).candidateStrategy==A(Ue).START_USER_MULTI_LEVEL_DEPT_LEADER||A(i).candidateStrategy==A(Ue).FORM_DEPT_LEADER?(W(),re(N,{key:7,label:A(g),prop:"deptLevel",span:"24"},{default:D(()=>[T(C,{modelValue:A(v),"onUpdate:modelValue":y[8]||(y[8]=U=>ze(v)?v.value=U:null),clearable:"",onChange:b},{default:D(()=>[(W(!0),pe(Le,null,We(A(Gx),(U,V)=>(W(),re(x,{key:V,label:U.label,value:U.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"])):fe("",!0),A(i).candidateStrategy===A(Ue).EXPRESSION?(W(),re(N,{key:8,label:"\u6D41\u7A0B\u8868\u8FBE\u5F0F",prop:"candidateParam"},{default:D(()=>[T(B,{type:"textarea",modelValue:A(i).candidateParam[0],"onUpdate:modelValue":y[9]||(y[9]=U=>A(i).candidateParam[0]=U),clearable:"",style:{width:"100%"},onChange:b},null,8,["modelValue"]),T(H,{class:"!w-1/1 mt-5px",type:"success",preIcon:"ep:select",title:"\u9009\u62E9\u8868\u8FBE\u5F0F",size:"small",onClick:S}),T(rx,{ref_key:"processExpressionDialogRef",ref:w,onSelect:k},null,512)]),_:1})):fe("",!0)]),_:1})}}}),LT=et({name:"ServiceTask",__name:"ServiceTask",props:{id:String,type:String},setup(e){const t=e,n=F({executeType:"",class:"",expression:"",delegateExpression:""}),i=F({}),r=F(),o=()=>window==null?void 0:window.bpmnInstances,a=()=>{let s=Object.create(null);const c=i.value.executeType;for(let u in i.value)u!=="executeType"&&u!==c&&(s[u]=null);s[c]=i.value[c]||"",o().modeling.updateProperties(Te(r.value),s)};return An(()=>{r.value=null}),qe(()=>t.id,()=>{r.value=o().bpmnElement,it(()=>{(()=>{var s;for(let c in n.value){let u=((s=r.value)==null?void 0:s.businessObject[c])||n.value[c];i.value[c]=u,u&&(i.value.executeType=c)}})()})},{immediate:!0}),(s,c)=>{const u=Cn,p=kn,d=Nt,m=Jt;return W(),pe("div",null,[T(d,{label:"\u6267\u884C\u7C7B\u578B",key:"executeType"},{default:D(()=>[T(p,{modelValue:A(i).executeType,"onUpdate:modelValue":c[0]||(c[0]=f=>A(i).executeType=f)},{default:D(()=>[T(u,{label:"Java\u7C7B",value:"class"}),T(u,{label:"\u8868\u8FBE\u5F0F",value:"expression"}),T(u,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",value:"delegateExpression"})]),_:1},8,["modelValue"])]),_:1}),A(i).executeType==="class"?(W(),re(d,{label:"Java\u7C7B",prop:"class",key:"execute-class"},{default:D(()=>[T(m,{modelValue:A(i).class,"onUpdate:modelValue":c[1]||(c[1]=f=>A(i).class=f),clearable:"",onChange:a},null,8,["modelValue"])]),_:1})):fe("",!0),A(i).executeType==="expression"?(W(),re(d,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"execute-expression"},{default:D(()=>[T(m,{modelValue:A(i).expression,"onUpdate:modelValue":c[2]||(c[2]=f=>A(i).expression=f),clearable:"",onChange:a},null,8,["modelValue"])]),_:1})):fe("",!0),A(i).executeType==="delegateExpression"?(W(),re(d,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"execute-delegate"},{default:D(()=>[T(m,{modelValue:A(i).delegateExpression,"onUpdate:modelValue":c[3]||(c[3]=f=>A(i).delegateExpression=f),clearable:"",onChange:a},null,8,["modelValue"])]),_:1})):fe("",!0)])}}}),jT={style:{"margin-top":"16px"}},VT=et({name:"ScriptTask",__name:"ScriptTask",props:{id:String,type:String},setup(e){const t=e,n=F({scriptFormat:"",script:"",resource:"",resultVariable:""}),i=F({}),r=F(),o=()=>window==null?void 0:window.bpmnInstances,a=()=>{let s=Object.create(null);s.scriptFormat=i.value.scriptFormat||null,s.resultVariable=i.value.resultVariable||null,i.value.scriptType==="inline"?(s.script=i.value.script||null,s.resource=null):(s.resource=i.value.resource||null,s.script=null),o().modeling.updateProperties(Te(r.value),s)};return An(()=>{r.value=null}),qe(()=>t.id,()=>{r.value=o().bpmnElement,it(()=>{(()=>{var s;for(let c in n.value){let u=((s=r.value)==null?void 0:s.businessObject[c])||n.value[c];i.value[c]=u}i.value.scriptType=i.value.script?"inline":"external"})()})},{immediate:!0}),(s,c)=>{const u=Jt,p=Nt,d=Cn,m=kn;return W(),pe("div",jT,[T(p,{label:"\u811A\u672C\u683C\u5F0F"},{default:D(()=>[T(u,{modelValue:A(i).scriptFormat,"onUpdate:modelValue":c[0]||(c[0]=f=>A(i).scriptFormat=f),clearable:"",onInput:c[1]||(c[1]=f=>a()),onChange:c[2]||(c[2]=f=>a())},null,8,["modelValue"])]),_:1}),T(p,{label:"\u811A\u672C\u7C7B\u578B"},{default:D(()=>[T(m,{modelValue:A(i).scriptType,"onUpdate:modelValue":c[3]||(c[3]=f=>A(i).scriptType=f)},{default:D(()=>[T(d,{label:"\u5185\u8054\u811A\u672C",value:"inline"}),T(d,{label:"\u5916\u90E8\u8D44\u6E90",value:"external"})]),_:1},8,["modelValue"])]),_:1}),xi(T(p,{label:"\u811A\u672C"},{default:D(()=>[T(u,{modelValue:A(i).script,"onUpdate:modelValue":c[4]||(c[4]=f=>A(i).script=f),type:"textarea",resize:"vertical",autosize:{minRows:2,maxRows:4},clearable:"",onInput:c[5]||(c[5]=f=>a()),onChange:c[6]||(c[6]=f=>a())},null,8,["modelValue"])]),_:1},512),[[Ja,A(i).scriptType==="inline"]]),xi(T(p,{label:"\u8D44\u6E90\u5730\u5740"},{default:D(()=>[T(u,{modelValue:A(i).resource,"onUpdate:modelValue":c[7]||(c[7]=f=>A(i).resource=f),clearable:"",onInput:c[8]||(c[8]=f=>a()),onChange:c[9]||(c[9]=f=>a())},null,8,["modelValue"])]),_:1},512),[[Ja,A(i).scriptType==="external"]]),T(p,{label:"\u7ED3\u679C\u53D8\u91CF"},{default:D(()=>[T(u,{modelValue:A(i).resultVariable,"onUpdate:modelValue":c[10]||(c[10]=f=>A(i).resultVariable=f),clearable:"",onInput:c[11]||(c[11]=f=>a()),onChange:c[12]||(c[12]=f=>a())},null,8,["modelValue"])]),_:1})])}}}),$T={style:{"margin-top":"16px"}},FT={style:{display:"flex","align-items":"center","justify-content":"space-between","flex-wrap":"nowrap"}},zT=et({name:"ReceiveTask",__name:"ReceiveTask",props:{id:String,type:String},setup(e){const t=e,n=Dc(),i=F(""),r=F({}),o=F({}),a=F(!1),s=F(),c=F(),u=F(),p=()=>window.bpmnInstances,d=()=>{a.value=!0,r.value={}},m=()=>{if(o.value[r.value.id])return void n.error("\u8BE5\u6D88\u606F\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const v=p().moddle.create("bpmn:Message",r.value);u.value.push(v),o.value[r.value.id]=r.value.name,c.value[r.value.id]=v,a.value=!1},f=v=>{v==="-1"?p().modeling.updateProperties(Te(s.value),{messageRef:null}):p().modeling.updateProperties(Te(s.value),{messageRef:c.value[v]})};return nr(()=>{c.value=Object.create(null),u.value=p().modeler.getDefinitions().rootElements,u.value.filter(v=>v.$type==="bpmn:Message").forEach(v=>{c.value[v.id]=v,o.value[v.id]=v.name}),o.value[-1]="\u65E0"}),An(()=>{s.value=null}),qe(()=>t.id,()=>{it(()=>{var v,g;s.value=p().bpmnElement,i.value=((g=(v=s.value.businessObject)==null?void 0:v.messageRef)==null?void 0:g.id)||"-1"})},{immediate:!0}),(v,g)=>{const E=Cn,_=kn,b=Jn,w=Nt,S=Jt,k=an,l=on,h=tr;return W(),pe("div",$T,[T(w,{label:"\u6D88\u606F\u5B9E\u4F8B"},{default:D(()=>[me("div",FT,[T(_,{modelValue:A(i),"onUpdate:modelValue":g[0]||(g[0]=y=>ze(i)?i.value=y:null),onChange:f},{default:D(()=>[(W(!0),pe(Le,null,We(Object.keys(A(o)),y=>(W(),re(E,{value:y,label:A(o)[y],key:y},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]),T(b,{type:"primary",preIcon:"ep:plus",style:{"margin-left":"8px"},onClick:d})])]),_:1}),T(h,{modelValue:A(a),"onUpdate:modelValue":g[3]||(g[3]=y=>ze(a)?a.value=y:null),"close-on-click-modal":!1,title:"\u521B\u5EFA\u65B0\u6D88\u606F",width:"400px","append-to-body":"","destroy-on-close":""},{footer:D(()=>[T(l,{size:"small",type:"primary",onClick:m},{default:D(()=>g[4]||(g[4]=[ce("\u786E \u8BA4")])),_:1})]),default:D(()=>[T(k,{model:A(r),size:"small","label-width":"90px"},{default:D(()=>[T(w,{label:"\u6D88\u606FID"},{default:D(()=>[T(S,{modelValue:A(r).id,"onUpdate:modelValue":g[1]||(g[1]=y=>A(r).id=y),clearable:""},null,8,["modelValue"])]),_:1}),T(w,{label:"\u6D88\u606F\u540D\u79F0"},{default:D(()=>[T(S,{modelValue:A(r).name,"onUpdate:modelValue":g[2]||(g[2]=y=>A(r).name=y),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),UT={class:"flex mb-10px"},HT={class:"flex mb-10px"},GT=et({name:"CallActivity",__name:"CallActivity",props:{id:String,type:String},setup(e){const t=e,n=ln("prefix"),i=Dc(),r=F({processInstanceName:"",calledElement:"",inheritVariables:!1,businessKey:"",inheritBusinessKey:!1,calledElementType:"key"}),o=F(),a=F(),s=F(),c=F(-1),u=F(!1),p=F(),d=F({source:"",target:""}),m=()=>window==null?void 0:window.bpmnInstances,f=F(),v=F(),g=S=>{m().modeling.updateProperties(Te(f.value),{[S]:r.value[S]})},E=(S,k,l)=>{c.value=l,s.value=S,d.value=l===-1?{}:{...k},u.value=!0},_=async(S,k)=>{try{await i.delConfirm(),S==="in"&&o.value.splice(k,1),S==="out"&&a.value.splice(k,1),w()}catch{}},b=()=>{c.value===-1?(s.value==="in"&&o.value.push(m().moddle.create(`${n}:In`,{...d.value})),s.value==="out"&&a.value.push(m().moddle.create(`${n}:Out`,{...d.value})),w()):(s.value==="in"&&(o.value[c.value].source=d.value.source,o.value[c.value].target=d.value.target),s.value==="out"&&(a.value[c.value].source=d.value.source,a.value[c.value].target=d.value.target)),u.value=!1},w=()=>{const S=m().moddle.create("bpmn:ExtensionElements",{values:[...o.value,...a.value,...v.value]});m().modeling.updateProperties(Te(f.value),{extensionElements:S})};return qe(()=>t.id,S=>{S&&S.length&&it(()=>{var k,l,h;f.value=m().bpmnElement,console.log(f.value.businessObject,"callActivity"),Object.keys(r.value).forEach(y=>{r.value[y]=f.value.businessObject[y]??r.value[y]}),v.value=[],o.value=[],a.value=[],(h=(l=(k=f.value.businessObject)==null?void 0:k.extensionElements)==null?void 0:l.values)==null||h.forEach(y=>{y.$type===`${n}:In`?o.value.push(y):y.$type===`${n}:Out`?a.value.push(y):v.value.push(y)})})},{immediate:!0}),(S,k)=>{const l=Jt,h=Nt,y=Bc,x=$r,C=xx,N=Jn,O=gi,B=on,H=bi,q=an,U=tr;return W(),pe("div",null,[T(q,{"label-width":"100px"},{default:D(()=>[T(h,{label:"\u5B9E\u4F8B\u540D\u79F0",prop:"processInstanceName"},{default:D(()=>[T(l,{modelValue:A(r).processInstanceName,"onUpdate:modelValue":k[0]||(k[0]=V=>A(r).processInstanceName=V),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5B9E\u4F8B\u540D\u79F0",onChange:k[1]||(k[1]=V=>g("processInstanceName"))},null,8,["modelValue"])]),_:1}),T(h,{label:"\u88AB\u8C03\u7528\u6D41\u7A0B",prop:"calledElement"},{default:D(()=>[T(l,{modelValue:A(r).calledElement,"onUpdate:modelValue":k[2]||(k[2]=V=>A(r).calledElement=V),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u88AB\u8C03\u7528\u6D41\u7A0B",onChange:k[3]||(k[3]=V=>g("calledElement"))},null,8,["modelValue"])]),_:1}),T(h,{label:"\u7EE7\u627F\u53D8\u91CF",prop:"inheritVariables"},{default:D(()=>[T(y,{modelValue:A(r).inheritVariables,"onUpdate:modelValue":k[4]||(k[4]=V=>A(r).inheritVariables=V),onChange:k[5]||(k[5]=V=>g("inheritVariables"))},null,8,["modelValue"])]),_:1}),T(h,{label:"\u7EE7\u627F\u4E1A\u52A1\u952E",prop:"inheritBusinessKey"},{default:D(()=>[T(y,{modelValue:A(r).inheritBusinessKey,"onUpdate:modelValue":k[6]||(k[6]=V=>A(r).inheritBusinessKey=V),onChange:k[7]||(k[7]=V=>g("inheritBusinessKey"))},null,8,["modelValue"])]),_:1}),A(r).inheritBusinessKey?fe("",!0):(W(),re(h,{key:0,label:"\u4E1A\u52A1\u952E\u8868\u8FBE\u5F0F",prop:"businessKey"},{default:D(()=>[T(l,{modelValue:A(r).businessKey,"onUpdate:modelValue":k[8]||(k[8]=V=>A(r).businessKey=V),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4E1A\u52A1\u952E\u8868\u8FBE\u5F0F",onChange:k[9]||(k[9]=V=>g("businessKey"))},null,8,["modelValue"])]),_:1})),T(x),me("div",null,[me("div",UT,[T(C,null,{default:D(()=>k[16]||(k[16]=[ce("\u8F93\u5165\u53C2\u6570")])),_:1}),T(N,{class:"ml-auto",type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u53C2\u6570",size:"small",onClick:k[10]||(k[10]=V=>E("in",null,-1))})]),T(H,{data:A(o),"max-height":"240",fit:"",border:""},{default:D(()=>[T(O,{label:"\u6E90",prop:"source","min-width":"100px","show-overflow-tooltip":""}),T(O,{label:"\u76EE\u6807",prop:"target","min-width":"100px","show-overflow-tooltip":""}),T(O,{label:"\u64CD\u4F5C",width:"110px"},{default:D(V=>[T(B,{link:"",onClick:te=>E("in",V.row,V.$index),size:"small"},{default:D(()=>k[17]||(k[17]=[ce(" \u7F16\u8F91 ")])),_:2},1032,["onClick"]),T(x,{direction:"vertical"}),T(B,{link:"",size:"small",style:{color:"#ff4d4f"},onClick:te=>_("in",V.$index)},{default:D(()=>k[18]||(k[18]=[ce(" \u79FB\u9664 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),T(x),me("div",null,[me("div",HT,[T(C,null,{default:D(()=>k[19]||(k[19]=[ce("\u8F93\u51FA\u53C2\u6570")])),_:1}),T(N,{class:"ml-auto",type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u53C2\u6570",size:"small",onClick:k[11]||(k[11]=V=>E("out",null,-1))})]),T(H,{data:A(a),"max-height":"240",fit:"",border:""},{default:D(()=>[T(O,{label:"\u6E90",prop:"source","min-width":"100px","show-overflow-tooltip":""}),T(O,{label:"\u76EE\u6807",prop:"target","min-width":"100px","show-overflow-tooltip":""}),T(O,{label:"\u64CD\u4F5C",width:"110px"},{default:D(V=>[T(B,{link:"",onClick:te=>E("out",V.row,V.$index),size:"small"},{default:D(()=>k[20]||(k[20]=[ce(" \u7F16\u8F91 ")])),_:2},1032,["onClick"]),T(x,{direction:"vertical"}),T(B,{link:"",size:"small",style:{color:"#ff4d4f"},onClick:te=>_("out",V.$index)},{default:D(()=>k[21]||(k[21]=[ce(" \u79FB\u9664 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_:1}),T(U,{modelValue:A(u),"onUpdate:modelValue":k[15]||(k[15]=V=>ze(u)?u.value=V:null),title:"\u53C2\u6570\u914D\u7F6E",width:"600px","append-to-body":"","destroy-on-close":""},{footer:D(()=>[T(B,{onClick:k[14]||(k[14]=V=>u.value=!1)},{default:D(()=>k[22]||(k[22]=[ce("\u53D6 \u6D88")])),_:1}),T(B,{type:"primary",onClick:b},{default:D(()=>k[23]||(k[23]=[ce("\u786E \u5B9A")])),_:1})]),default:D(()=>[T(q,{model:A(d),"label-width":"80px",ref_key:"varialbeFormRef",ref:p},{default:D(()=>[T(h,{label:"\u6E90\uFF1A",prop:"source"},{default:D(()=>[T(l,{modelValue:A(d).source,"onUpdate:modelValue":k[12]||(k[12]=V=>A(d).source=V),clearable:""},null,8,["modelValue"])]),_:1}),T(h,{label:"\u76EE\u6807\uFF1A",prop:"target"},{default:D(()=>[T(l,{modelValue:A(d).target,"onUpdate:modelValue":k[13]||(k[13]=V=>A(d).target=V),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),fh={UserTask:{name:"\u7528\u6237\u4EFB\u52A1",component:OT},ServiceTask:{name:"\u670D\u52A1\u4EFB\u52A1",component:LT},ScriptTask:{name:"\u811A\u672C\u4EFB\u52A1",component:VT},ReceiveTask:{name:"\u63A5\u6536\u4EFB\u52A1",component:zT},CallActivity:{name:"\u8C03\u7528\u6D3B\u52A8",component:GT}},WT=e=>fh[e].name,qT=e=>fh[e],KT={class:"panel-tab__content"},XT=et({name:"ElementTaskConfig",__name:"ElementTask",props:{id:String,type:String},setup(e){const t=e,n=F({asyncAfter:!1,asyncBefore:!1,exclusive:!1}),i=F(),r=F(),o=()=>window.bpmnInstances,a=()=>{n.value.asyncBefore||n.value.asyncAfter||(n.value.exclusive=!1),o().modeling.updateProperties(o().bpmnElement,{...n.value})};return qe(()=>t.id,()=>{var s,c,u,p,d,m;r.value=o().bpmnElement,n.value.asyncBefore=(c=(s=r.value)==null?void 0:s.businessObject)==null?void 0:c.asyncBefore,n.value.asyncAfter=(p=(u=r.value)==null?void 0:u.businessObject)==null?void 0:p.asyncAfter,n.value.exclusive=(m=(d=r.value)==null?void 0:d.businessObject)==null?void 0:m.exclusive},{immediate:!0}),qe(()=>t.type,()=>{t.type&&(i.value=fh[t.type].component)},{immediate:!0}),(s,c)=>{const u=xh,p=Nt,d=an;return W(),pe("div",KT,[T(d,{size:"small","label-width":"90px"},{default:D(()=>[T(p,{label:"\u5F02\u6B65\u5EF6\u7EED",style:{display:"none"}},{default:D(()=>[T(u,{modelValue:A(n).asyncBefore,"onUpdate:modelValue":c[0]||(c[0]=m=>A(n).asyncBefore=m),label:"\u5F02\u6B65\u524D",value:"\u5F02\u6B65\u524D",onChange:a},null,8,["modelValue"]),T(u,{modelValue:A(n).asyncAfter,"onUpdate:modelValue":c[1]||(c[1]=m=>A(n).asyncAfter=m),label:"\u5F02\u6B65\u540E",value:"\u5F02\u6B65\u540E",onChange:a},null,8,["modelValue"]),A(n).asyncAfter||A(n).asyncBefore?(W(),re(u,{key:0,modelValue:A(n).exclusive,"onUpdate:modelValue":c[2]||(c[2]=m=>A(n).exclusive=m),label:"\u6392\u9664",value:"\u6392\u9664",onChange:a},null,8,["modelValue"])):fe("",!0)]),_:1}),(W(),re(Sh(A(i)),Eh(wh(s.$props)),null,16))]),_:1})])}}}),YT={class:"panel-tab__content"},JT={class:"flex-col"},ZT=et({name:"ElementMultiInstance",__name:"ElementMultiInstance",props:{businessObject:Object,type:String,id:String},setup(e){const t=e,n=ln("prefix"),i=F("");F({completionCondition:"",loopCardinality:"",extensionElements:[],asyncAfter:!1,asyncBefore:!1,exclusive:!1});const r=F({}),o=F(null),a=F(null),s=()=>window==null?void 0:window.bpmnInstances,c=k=>{if(k!=="Null"){if(k==="StandardLoop"){const l=s().moddle.create("bpmn:StandardLoopCharacteristics");return s().modeling.updateProperties(Te(o.value),{loopCharacteristics:l}),void(a.value=null)}a.value=k==="SequentialMultiInstance"?s().moddle.create("bpmn:MultiInstanceLoopCharacteristics",{isSequential:!0}):s().moddle.create("bpmn:MultiInstanceLoopCharacteristics",{collection:"${coll_userList}"}),s().modeling.updateProperties(Te(o.value),{loopCharacteristics:Te(a.value)})}else s().modeling.updateProperties(Te(o.value),{loopCharacteristics:null})},u=k=>{let l=null;k&&k.length&&(l=s().moddle.create("bpmn:FormalExpression",{body:k})),s().modeling.updateModdleProperties(Te(o.value),a.value,{loopCardinality:l})},p=k=>{let l=null;k&&k.length&&(l=s().moddle.create("bpmn:FormalExpression",{body:k})),s().modeling.updateModdleProperties(Te(o.value),a.value,{completionCondition:l})},d=k=>{const l=s().moddle.create("bpmn:ExtensionElements",{values:[s().moddle.create(`${n}:FailedJobRetryTimeCycle`,{body:k})]});s().modeling.updateModdleProperties(Te(o.value),a.value,{extensionElements:l})},m=()=>{s().modeling.updateModdleProperties(Te(o.value),a.value,{collection:r.value.collection||null,elementVariable:r.value.elementVariable||null})},f=k=>{const{asyncBefore:l,asyncAfter:h}=r.value;let y=Object.create(null);l||h?y[k]=r.value[k]:(r.value.exclusive=!1,y={asyncBefore:!1,asyncAfter:!1,exclusive:!1,extensionElements:null}),s().modeling.updateModdleProperties(Te(o.value),a.value,y)},v=k=>{k==="\u4F9D\u6B21\u5BA1\u6279"?(c("SequentialMultiInstance"),u("1"),p("${ nrOfCompletedInstances >= nrOfInstances }")):k==="\u4F1A\u7B7E"?(c("ParallelMultiInstance"),p("${ nrOfCompletedInstances >= nrOfInstances }")):k==="\u6216\u7B7E"&&(c("ParallelMultiInstance"),p("${ nrOfCompletedInstances > 0 }"))},g=F(),E=F(100),_=F(),b=()=>{E.value=100,S()},w=()=>{S()},S=()=>{g.value===rr.RANDOM_SELECT_ONE_APPROVE?s().modeling.updateProperties(Te(o.value),{loopCharacteristics:null}):(g.value===rr.APPROVE_BY_RATIO&&(a.value=s().moddle.create("bpmn:MultiInstanceLoopCharacteristics",{isSequential:!1,collection:"${coll_userList}"}),a.value.completionCondition=s().moddle.create("bpmn:FormalExpression",{body:"${ nrOfCompletedInstances/nrOfInstances >= "+E.value/100+"}"})),g.value===rr.ANY_APPROVE&&(a.value=s().moddle.create("bpmn:MultiInstanceLoopCharacteristics",{isSequential:!1,collection:"${coll_userList}"}),a.value.completionCondition=s().moddle.create("bpmn:FormalExpression",{body:"${ nrOfCompletedInstances > 0 }"})),g.value===rr.SEQUENTIAL_APPROVE&&(a.value=s().moddle.create("bpmn:MultiInstanceLoopCharacteristics",{isSequential:!0,collection:"${coll_userList}"}),a.value.loopCardinality=s().moddle.create("bpmn:FormalExpression",{body:"1"}),a.value.completionCondition=s().moddle.create("bpmn:FormalExpression",{body:"${ nrOfCompletedInstances >= nrOfInstances }"})),s().modeling.updateProperties(Te(o.value),{loopCharacteristics:Te(a.value)}));const k=s().moddle.create("bpmn:ExtensionElements",{values:[..._.value,s().moddle.create(`${n}:ApproveMethod`,{value:g.value})]});s().modeling.updateProperties(Te(o.value),{extensionElements:k})};return An(()=>{a.value=null,o.value=null}),qe(()=>t.id,k=>{k&&it(()=>{o.value=s().bpmnElement,(()=>{var h,y,x;const l=((h=o.value.businessObject)==null?void 0:h.extensionElements)??s().moddle.create("bpmn:ExtensionElements",{values:[]});g.value=(x=(y=l.values.filter(C=>C.$type===`${n}:ApproveMethod`))==null?void 0:y[0])==null?void 0:x.value,_.value=l.values.filter(C=>C.$type!==`${n}:ApproveMethod`)??[],g.value||(g.value=rr.SEQUENTIAL_APPROVE,S())})()})},{immediate:!0}),(k,l)=>{const h=yh,y=gh,x=Nt,C=Ic,N=on,O=Cn,B=kn,H=Jt,q=xh,U=an;return W(),pe("div",YT,[T(C,{modelValue:A(g),"onUpdate:modelValue":l[1]||(l[1]=V=>ze(g)?g.value=V:null),onChange:b},{default:D(()=>[me("div",JT,[(W(!0),pe(Le,null,We(A(Wx),(V,te)=>(W(),pe("div",{key:te},[T(h,{value:V.value,label:V.value},{default:D(()=>[ce(sn(V.label),1)]),_:2},1032,["value","label"]),T(x,{prop:"approveRatio"},{default:D(()=>[V.value===A(rr).APPROVE_BY_RATIO&&A(g)===A(rr).APPROVE_BY_RATIO?(W(),re(y,{key:0,modelValue:A(E),"onUpdate:modelValue":l[0]||(l[0]=X=>ze(E)?E.value=X:null),min:10,max:100,step:10,size:"small",onChange:w},null,8,["modelValue"])):fe("",!0)]),_:2},1024)]))),128))])]),_:1},8,["modelValue"]),T(U,{"label-width":"90px",style:{display:"none"}},{default:D(()=>[T(x,{label:"\u5FEB\u6377\u914D\u7F6E"},{default:D(()=>[T(N,{size:"small",onClick:l[2]||(l[2]=V=>v("\u4F9D\u6B21\u5BA1\u6279"))},{default:D(()=>l[17]||(l[17]=[ce("\u4F9D\u6B21\u5BA1\u6279")])),_:1}),T(N,{size:"small",onClick:l[3]||(l[3]=V=>v("\u4F1A\u7B7E"))},{default:D(()=>l[18]||(l[18]=[ce("\u4F1A\u7B7E")])),_:1}),T(N,{size:"small",onClick:l[4]||(l[4]=V=>v("\u6216\u7B7E"))},{default:D(()=>l[19]||(l[19]=[ce("\u6216\u7B7E")])),_:1})]),_:1}),T(x,{label:"\u4F1A\u7B7E\u7C7B\u578B"},{default:D(()=>[T(B,{modelValue:A(i),"onUpdate:modelValue":l[5]||(l[5]=V=>ze(i)?i.value=V:null),onChange:c},{default:D(()=>[T(O,{label:"\u5E76\u884C\u591A\u91CD\u4E8B\u4EF6",value:"ParallelMultiInstance"}),T(O,{label:"\u65F6\u5E8F\u591A\u91CD\u4E8B\u4EF6",value:"SequentialMultiInstance"}),T(O,{label:"\u65E0",value:"Null"})]),_:1},8,["modelValue"])]),_:1}),A(i)==="ParallelMultiInstance"||A(i)==="SequentialMultiInstance"?(W(),pe(Le,{key:0},[T(x,{label:"\u5FAA\u73AF\u6570\u91CF",key:"loopCardinality"},{default:D(()=>[T(H,{modelValue:A(r).loopCardinality,"onUpdate:modelValue":l[6]||(l[6]=V=>A(r).loopCardinality=V),clearable:"",onChange:u},null,8,["modelValue"])]),_:1}),xi(T(x,{label:"\u96C6\u5408",key:"collection"},{default:D(()=>[T(H,{modelValue:A(r).collection,"onUpdate:modelValue":l[7]||(l[7]=V=>A(r).collection=V),clearable:"",onChange:m},null,8,["modelValue"])]),_:1},512),[[Ja,!1]]),T(x,{label:"\u5143\u7D20\u53D8\u91CF",key:"elementVariable",style:{display:"none"}},{default:D(()=>[T(H,{modelValue:A(r).elementVariable,"onUpdate:modelValue":l[8]||(l[8]=V=>A(r).elementVariable=V),clearable:"",onChange:m},null,8,["modelValue"])]),_:1}),T(x,{label:"\u5B8C\u6210\u6761\u4EF6",key:"completionCondition"},{default:D(()=>[T(H,{modelValue:A(r).completionCondition,"onUpdate:modelValue":l[9]||(l[9]=V=>A(r).completionCondition=V),clearable:"",onChange:p},null,8,["modelValue"])]),_:1}),T(x,{label:"\u5F02\u6B65\u72B6\u6001",key:"async",style:{display:"none"}},{default:D(()=>[T(q,{modelValue:A(r).asyncBefore,"onUpdate:modelValue":l[10]||(l[10]=V=>A(r).asyncBefore=V),label:"\u5F02\u6B65\u524D",value:"\u5F02\u6B65\u524D",onChange:l[11]||(l[11]=V=>f("asyncBefore"))},null,8,["modelValue"]),T(q,{modelValue:A(r).asyncAfter,"onUpdate:modelValue":l[12]||(l[12]=V=>A(r).asyncAfter=V),label:"\u5F02\u6B65\u540E",value:"\u5F02\u6B65\u540E",onChange:l[13]||(l[13]=V=>f("asyncAfter"))},null,8,["modelValue"]),A(r).asyncAfter||A(r).asyncBefore?(W(),re(q,{key:0,modelValue:A(r).exclusive,"onUpdate:modelValue":l[14]||(l[14]=V=>A(r).exclusive=V),label:"\u6392\u9664",value:"\u6392\u9664",onChange:l[15]||(l[15]=V=>f("exclusive"))},null,8,["modelValue"])):fe("",!0)]),_:1}),A(r).asyncAfter||A(r).asyncBefore?(W(),re(x,{label:"\u91CD\u8BD5\u5468\u671F",prop:"timeCycle",key:"timeCycle"},{default:D(()=>[T(H,{modelValue:A(r).timeCycle,"onUpdate:modelValue":l[16]||(l[16]=V=>A(r).timeCycle=V),clearable:"",onChange:d},null,8,["modelValue"])]),_:1})):fe("",!0)],64)):fe("",!0)]),_:1})])}}}),QT={class:"panel-tab__content"},eP=et({name:"FlowCondition",__name:"FlowCondition",props:{businessObject:Object,type:String},setup(e){const t=e,n=F({}),i=F(),r=F(),o=F(),a=F(),s=()=>window==null?void 0:window.bpmnInstances,c=f=>f==="condition"?(a.value=s().moddle.create("bpmn:FormalExpression"),void s().modeling.updateProperties(Te(i.value),{conditionExpression:a.value})):f==="default"?(s().modeling.updateProperties(Te(i.value),{conditionExpression:null}),void s().modeling.updateProperties(Te(r.value),{default:Te(i.value)})):(o.value.default&&o.value.default.id===i.value.id&&s().modeling.updateProperties(Te(r.value),{default:null}),void s().modeling.updateProperties(Te(i.value),{conditionExpression:null})),u=()=>{let f,{conditionType:v,scriptType:g,body:E,resource:_,language:b}=n.value;v==="expression"?f=s().moddle.create("bpmn:FormalExpression",{body:E}):g==="inlineScript"?(f=s().moddle.create("bpmn:FormalExpression",{body:E,language:b}),n.value.resource=""):(n.value.body="",f=s().moddle.create("bpmn:FormalExpression",{resource:_,language:b})),s().modeling.updateProperties(Te(i.value),{conditionExpression:f})},p=F(),d=async()=>{p.value.open()},m=f=>{n.value.body=f.expression};return An(()=>{i.value=null,r.value=null,o.value=null}),qe(()=>t.businessObject,f=>{console.log(f,"val"),it(()=>{(()=>{if(i.value=s().bpmnElement,r.value=i.value.source,o.value=i.value.businessObject.sourceRef,n.value={type:"default"},o.value&&o.value.default&&o.value.default.id===i.value.id)n.value={type:"default"};else if(i.value.businessObject.conditionExpression){const v=i.value.businessObject.conditionExpression;if(n.value={...v,type:"condition"},n.value.resource)return n.value.conditionType="script",void(n.value.scriptType="externalScript");if(v.language)return n.value.conditionType="script",void(n.value.scriptType="inlineScript");n.value.conditionType="expression"}else n.value={type:"normal"}})()})},{immediate:!0}),(f,v)=>{const g=Cn,E=kn,_=Nt,b=Jt,w=Jn,S=an;return W(),pe("div",QT,[T(S,{model:A(n),"label-width":"90px",size:"small"},{default:D(()=>[T(_,{label:"\u6D41\u8F6C\u7C7B\u578B"},{default:D(()=>[T(E,{modelValue:A(n).type,"onUpdate:modelValue":v[0]||(v[0]=k=>A(n).type=k),onChange:c},{default:D(()=>[T(g,{label:"\u666E\u901A\u6D41\u8F6C\u8DEF\u5F84",value:"normal"}),T(g,{label:"\u9ED8\u8BA4\u6D41\u8F6C\u8DEF\u5F84",value:"default"}),T(g,{label:"\u6761\u4EF6\u6D41\u8F6C\u8DEF\u5F84",value:"condition"})]),_:1},8,["modelValue"])]),_:1}),A(n).type==="condition"?(W(),re(_,{label:"\u6761\u4EF6\u683C\u5F0F",key:"condition"},{default:D(()=>[T(E,{modelValue:A(n).conditionType,"onUpdate:modelValue":v[1]||(v[1]=k=>A(n).conditionType=k)},{default:D(()=>[T(g,{label:"\u8868\u8FBE\u5F0F",value:"expression"}),T(g,{label:"\u811A\u672C",value:"script"})]),_:1},8,["modelValue"])]),_:1})):fe("",!0),A(n).conditionType&&A(n).conditionType==="expression"?(W(),re(_,{label:"\u8868\u8FBE\u5F0F",key:"express"},{default:D(()=>[T(b,{type:"textarea",modelValue:A(n).body,"onUpdate:modelValue":v[2]||(v[2]=k=>A(n).body=k),clearable:"",style:{width:"100%"},onChange:u},null,8,["modelValue"]),T(w,{class:"!w-1/1 mt-5px",type:"success",preIcon:"ep:select",title:"\u9009\u62E9\u8868\u8FBE\u5F0F",size:"small",onClick:d}),T(rx,{ref_key:"processExpressionDialogRef",ref:p,onSelect:m},null,512)]),_:1})):fe("",!0),A(n).conditionType&&A(n).conditionType==="script"?(W(),pe(Le,{key:2},[T(_,{label:"\u811A\u672C\u8BED\u8A00",key:"language"},{default:D(()=>[T(b,{modelValue:A(n).language,"onUpdate:modelValue":v[3]||(v[3]=k=>A(n).language=k),clearable:"",onChange:u},null,8,["modelValue"])]),_:1}),T(_,{label:"\u811A\u672C\u7C7B\u578B",key:"scriptType"},{default:D(()=>[T(E,{modelValue:A(n).scriptType,"onUpdate:modelValue":v[4]||(v[4]=k=>A(n).scriptType=k)},{default:D(()=>[T(g,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),T(g,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),A(n).scriptType==="inlineScript"?(W(),re(_,{label:"\u811A\u672C",key:"body"},{default:D(()=>[T(b,{modelValue:A(n).body,"onUpdate:modelValue":v[5]||(v[5]=k=>A(n).body=k),type:"textarea",clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):fe("",!0),A(n).scriptType==="externalScript"?(W(),re(_,{label:"\u8D44\u6E90\u5730\u5740",key:"resource"},{default:D(()=>[T(b,{modelValue:A(n).resource,"onUpdate:modelValue":v[6]||(v[6]=k=>A(n).resource=k),clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):fe("",!0)],64)):fe("",!0)]),_:1},8,["model"])])}}}),tP={class:"panel-tab__content"},nP={class:"panel-tab__content--title"},iP={class:"panel-tab__content--title",style:{"padding-top":"8px","margin-top":"8px","border-top":"1px solid #eee"}},rP=et({name:"SignalAndMassage",__name:"SignalAndMessage",setup(e){const t=Dc(),n=F([]),i=F([]),r=F(!1),o=F(""),a=F({}),s=F(),c=F(),u=F(),p=Fr(()=>o.value==="message"?{title:"\u521B\u5EFA\u6D88\u606F",idLabel:"\u6D88\u606FID",nameLabel:"\u6D88\u606F\u540D\u79F0"}:{title:"\u521B\u5EFA\u4FE1\u53F7",idLabel:"\u4FE1\u53F7ID",nameLabel:"\u4FE1\u53F7\u540D\u79F0"}),d=()=>window==null?void 0:window.bpmnInstances,m=()=>{console.log(window,"window"),s.value=d().modeler.getDefinitions().rootElements,c.value={},u.value={},i.value=[],n.value=[],s.value.forEach(g=>{g.$type==="bpmn:Message"&&(c.value[g.id]=!0,i.value.push({...g})),g.$type==="bpmn:Signal"&&(u.value[g.id]=!0,n.value.push({...g}))})},f=g=>{o.value=g,a.value={},r.value=!0},v=()=>{if(o.value==="message"){c.value[a.value.id]&&t.error("\u8BE5\u6D88\u606F\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const g=d().moddle.create("bpmn:Message",a.value);s.value.push(g)}else{u.value[a.value.id]&&t.error("\u8BE5\u4FE1\u53F7\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const g=d().moddle.create("bpmn:Signal",a.value);s.value.push(g)}r.value=!1,m()};return nr(()=>{m()}),(g,E)=>{const _=Mo,b=Jn,w=gi,S=bi,k=Jt,l=Nt,h=an,y=on,x=tr;return W(),pe("div",tP,[me("div",nP,[me("span",null,[T(_,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),E[6]||(E[6]=ce("\u6D88\u606F\u5217\u8868"))]),T(b,{type:"primary",title:"\u521B\u5EFA\u65B0\u6D88\u606F",preIcon:"ep:plus",onClick:E[0]||(E[0]=C=>f("message"))})]),T(S,{data:A(i),border:""},{default:D(()=>[T(w,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),T(w,{label:"\u6D88\u606FID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),T(w,{label:"\u6D88\u606F\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),me("div",iP,[me("span",null,[T(_,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),E[7]||(E[7]=ce("\u4FE1\u53F7\u5217\u8868"))]),T(b,{type:"primary",title:"\u521B\u5EFA\u65B0\u4FE1\u53F7",preIcon:"ep:plus",onClick:E[1]||(E[1]=C=>f("signal"))})]),T(S,{data:A(n),border:""},{default:D(()=>[T(w,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),T(w,{label:"\u4FE1\u53F7ID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),T(w,{label:"\u4FE1\u53F7\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),T(x,{modelValue:A(r),"onUpdate:modelValue":E[5]||(E[5]=C=>ze(r)?r.value=C:null),title:A(p).title,"close-on-click-modal":!1,width:"400px","append-to-body":"","destroy-on-close":""},{footer:D(()=>[T(y,{onClick:E[4]||(E[4]=C=>r.value=!1)},{default:D(()=>E[8]||(E[8]=[ce("\u53D6 \u6D88")])),_:1}),T(y,{type:"primary",onClick:v},{default:D(()=>E[9]||(E[9]=[ce("\u4FDD \u5B58")])),_:1})]),default:D(()=>[T(h,{model:A(a),"label-width":"90px"},{default:D(()=>[T(l,{label:A(p).idLabel},{default:D(()=>[T(k,{modelValue:A(a).id,"onUpdate:modelValue":E[2]||(E[2]=C=>A(a).id=C),clearable:""},null,8,["modelValue"])]),_:1},8,["label"]),T(l,{label:A(p).nameLabel},{default:D(()=>[T(k,{modelValue:A(a).name,"onUpdate:modelValue":E[3]||(E[3]=C=>A(a).name=C),clearable:""},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["modelValue","title"])])}}}),Lr=()=>window==null?void 0:window.bpmnInstances;function Ac(e,t,n){const i=Object.create(null);switch(i.event=e.event,t&&(i.id=e.id),e.listenerType){case"scriptListener":i.script=function(r,o){const{scriptType:a,scriptFormat:s,value:c,resource:u}=r,p=a==="inlineScript"?{scriptFormat:s,value:c}:{scriptFormat:s,resource:u};return Lr().moddle.create(`${o}:Script`,p)}(e,n);break;case"expressionListener":i.expression=e.expression;break;case"delegateExpressionListener":i.delegateExpression=e.delegateExpression;break;default:i.class=e.class}if(e.fields&&(i.fields=e.fields.map(r=>function(o,a){const{name:s,fieldType:c,string:u,expression:p}=o,d=c==="string"?{name:s,string:u}:{name:s,expression:p};return Lr().moddle.create(`${a}:Field`,d)}(r,n))),t&&e.event==="timeout"&&e.eventDefinitionType){const r=Lr().moddle.create("bpmn:FormalExpression",{body:e.eventTimeDefinitions}),o=Lr().moddle.create("bpmn:TimerEventDefinition",{id:`TimerEventDefinition_${oP(8)}`,[`time${e.eventDefinitionType.replace(/^\S/,a=>a.toUpperCase())}`]:r});i.eventDefinitions=[o]}return Lr().moddle.create(`${n}:${t?"TaskListener":"ExecutionListener"}`,i)}function Ro(e,t){const n=Lr().moddle.create("bpmn:ExtensionElements",{values:t});Lr().modeling.updateProperties(Te(e),{extensionElements:n})}function oP(e=8,t){let n="";for(let i=e;i>0;--i)n+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return n}function ox(e){let t={...e};if(e.script&&(t={...e,...e.script,scriptType:e.script.resource?"externalScript":"inlineScript"}),e.event==="timeout"&&e.eventDefinitions&&e.eventDefinitions.length){let n="";for(const i in e.eventDefinitions[0])console.log(e.eventDefinitions,i),i.indexOf("time")!==-1&&(n=i,t.eventDefinitionType=i.replace("time","").toLowerCase());console.log(n),t.eventTimeDefinitions=e.eventDefinitions[0][n].body}return t}function ax(e){let t;return e.class&&(t="classListener"),e.expression&&(t="expressionListener"),e.delegateExpression&&(t="delegateExpressionListener"),e.script&&(t="scriptListener"),{...JSON.parse(JSON.stringify(e)),...e.script??{},listenerType:t}}function sx(e){if(e.valueType==="class")return{listenerType:"classListener",class:e.value,event:e.event,fields:[]};if(e.valueType==="expression")return{listenerType:"expressionListener",expression:e.value,event:e.event,fields:[]};if(e.valueType==="delegateExpression")return{listenerType:"delegateExpressionListener",delegateExpression:e.value,event:e.event,fields:[]};throw new Error("\u672A\u77E5\u7684\u76D1\u542C\u5668\u7C7B\u578B")}const lx={classListener:"Java \u7C7B",expressionListener:"\u8868\u8FBE\u5F0F",delegateExpressionListener:"\u4EE3\u7406\u8868\u8FBE\u5F0F",scriptListener:"\u811A\u672C"},aP={create:"\u521B\u5EFA",assignment:"\u6307\u6D3E",complete:"\u5B8C\u6210",delete:"\u5220\u9664",update:"\u66F4\u65B0",timeout:"\u8D85\u65F6"},cx={string:"\u5B57\u7B26\u4E32",expression:"\u8868\u8FBE\u5F0F"},ux=et({name:"ProcessListenerDialog",__name:"ProcessListenerDialog",emits:["success"],setup(e,{expose:t,emit:n}){const i=F(!1),r=F(!0),o=F([]),a=F(0),s=jc({pageNo:1,pageSize:10,type:"",status:Nh.ENABLE});t({open:async p=>{s.pageNo=1,s.type=p,c(),i.value=!0}});const c=async()=>{r.value=!0;try{const p=await n_.getProcessListenerPage(s);o.value=p.list,a.value=p.total}finally{r.value=!1}},u=n;return(p,d)=>{const m=gi,f=Bh,v=on,g=bi,E=Mh,_=Rh,b=Nc,w=bh;return W(),re(b,{title:"\u8BF7\u9009\u62E9\u76D1\u542C\u5668",modelValue:A(i),"onUpdate:modelValue":d[2]||(d[2]=S=>ze(i)?i.value=S:null),width:"1024px"},{default:D(()=>[T(_,null,{default:D(()=>[xi((W(),re(g,{data:A(o),stripe:!0,"show-overflow-tooltip":!0},{default:D(()=>[T(m,{label:"\u540D\u5B57",align:"center",prop:"name"}),T(m,{label:"\u7C7B\u578B",align:"center",prop:"type"},{default:D(S=>[T(f,{type:A(Oc).BPM_PROCESS_LISTENER_TYPE,value:S.row.type},null,8,["type","value"])]),_:1}),T(m,{label:"\u4E8B\u4EF6",align:"center",prop:"event"}),T(m,{label:"\u503C\u7C7B\u578B",align:"center",prop:"valueType"},{default:D(S=>[T(f,{type:A(Oc).BPM_PROCESS_LISTENER_VALUE_TYPE,value:S.row.valueType},null,8,["type","value"])]),_:1}),T(m,{label:"\u503C",align:"center",prop:"value"}),T(m,{label:"\u64CD\u4F5C",align:"center"},{default:D(S=>[T(v,{link:"",type:"primary",onClick:k=>(async l=>{i.value=!1,u("select",l)})(S.row)},{default:D(()=>d[3]||(d[3]=[ce(" \u9009\u62E9 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[w,A(r)]]),T(E,{total:A(a),page:A(s).pageNo,"onUpdate:page":d[0]||(d[0]=S=>A(s).pageNo=S),limit:A(s).pageSize,"onUpdate:limit":d[1]||(d[1]=S=>A(s).pageSize=S),onPagination:c},null,8,["total","page","limit"])]),_:1})]),_:1},8,["modelValue"])}}}),sP={class:"panel-tab__content"},lP={class:"element-drawer__button"},cP={class:"listener-filed__title"},uP={class:"element-drawer__button"},pP=et({name:"ElementListeners",__name:"ElementListeners",props:{id:String,type:String},setup(e){const t=e,n=ln("prefix"),i=ln("width"),r=F([]),o=F({}),a=F(!1),s=F([]),c=F({}),u=F(!1),p=F(-1),d=F(-1),m=F(lx),f=F(cx),v=F(),g=F(),E=F(),_=F(),b=F(),w=(C,N)=>{C?(o.value=ox(C),p.value=N):(o.value={},p.value=-1),C&&C.fields?s.value=C.fields.map(O=>({...O,fieldType:O.string?"string":"expression"})):(s.value=[],o.value.fields=[]),a.value=!0,it(()=>{_.value&&_.value.clearValidate()})},S=(C,N)=>{c.value=C?JSON.parse(JSON.stringify(C)):{},d.value=C?N:-1,u.value=!0,it(()=>{b.value&&b.value.clearValidate()})},k=async()=>{await b.value.validate()&&(d.value===-1?(s.value.push(c.value),o.value.fields.push(c.value)):(s.value.splice(d.value,1,c.value),o.value.fields.splice(d.value,1,c.value)),u.value=!1,it(()=>{c.value={}}))},l=async()=>{var N,O,B;if(!await _.value.validate())return;const C=Ac(o.value,!1,n);p.value===-1?(E.value.push(C),r.value.push(o.value)):(E.value.splice(p.value,1,C),r.value.splice(p.value,1,o.value)),g.value=((B=(O=(N=v.value.businessObject)==null?void 0:N.extensionElements)==null?void 0:O.values)==null?void 0:B.filter(H=>H.$type!==`${n}:ExecutionListener`))??[],Ro(v.value,g.value.concat(E.value)),a.value=!1,o.value={}},h=F(),y=async()=>{h.value.open("execution")},x=C=>{var B,H,q;const N=sx(C),O=Ac(N,!1,n);E.value.push(O),r.value.push(N),g.value=((q=(H=(B=v.value.businessObject)==null?void 0:B.extensionElements)==null?void 0:H.values)==null?void 0:q.filter(U=>U.$type!==`${n}:ExecutionListener`))??[],Ro(v.value,g.value.concat(E.value))};return qe(()=>t.id,C=>{C&&C.length&&it(()=>{var N,O,B;v.value=(window==null?void 0:window.bpmnInstances).bpmnElement,g.value=[],E.value=((B=(O=(N=v.value.businessObject)==null?void 0:N.extensionElements)==null?void 0:O.values)==null?void 0:B.filter(H=>H.$type===`${n}:ExecutionListener`))??[],r.value=E.value.map(H=>ax(H))})},{immediate:!0}),(C,N)=>{const O=gi,B=on,H=$r,q=bi,U=Jn,V=Cn,te=kn,X=Nt,oe=Jt,ne=an,I=Mo,R=Ih,M=tr;return W(),pe(Le,null,[me("div",sP,[T(q,{data:A(r),size:"small",border:""},{default:D(()=>[T(O,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),T(O,{label:"\u4E8B\u4EF6\u7C7B\u578B","min-width":"100px",prop:"event"}),T(O,{label:"\u76D1\u542C\u5668\u7C7B\u578B","min-width":"100px","show-overflow-tooltip":"",formatter:L=>A(m)[L.listenerType]},null,8,["formatter"]),T(O,{label:"\u64CD\u4F5C",width:"100px"},{default:D(L=>[T(B,{size:"small",link:"",onClick:K=>w(L.row,L.$index)},{default:D(()=>N[19]||(N[19]=[ce("\u7F16\u8F91")])),_:2},1032,["onClick"]),T(H,{direction:"vertical"}),T(B,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:K=>(j=>{Vr.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{E.value.splice(j,1),r.value.splice(j,1),Ro(v.value,g.value.concat(E.value))}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(L.$index)},{default:D(()=>N[20]||(N[20]=[ce("\u79FB\u9664")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),me("div",lP,[T(U,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",size:"small",onClick:N[0]||(N[0]=L=>w(null))}),T(U,{type:"success",preIcon:"ep:select",title:"\u9009\u62E9\u76D1\u542C\u5668",size:"small",onClick:y})]),T(R,{modelValue:A(a),"onUpdate:modelValue":N[12]||(N[12]=L=>ze(a)?a.value=L:null),title:"\u6267\u884C\u76D1\u542C\u5668",size:`${A(i)}px`,"append-to-body":"","destroy-on-close":""},{default:D(()=>[T(ne,{model:A(o),"label-width":"96px",ref_key:"listenerFormRef",ref:_},{default:D(()=>[T(X,{label:"\u4E8B\u4EF6\u7C7B\u578B",prop:"event",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(te,{modelValue:A(o).event,"onUpdate:modelValue":N[1]||(N[1]=L=>A(o).event=L)},{default:D(()=>[T(V,{label:"start",value:"start"}),T(V,{label:"end",value:"end"})]),_:1},8,["modelValue"])]),_:1}),T(X,{label:"\u76D1\u542C\u5668\u7C7B\u578B",prop:"listenerType",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(te,{modelValue:A(o).listenerType,"onUpdate:modelValue":N[2]||(N[2]=L=>A(o).listenerType=L)},{default:D(()=>[(W(!0),pe(Le,null,We(Object.keys(A(m)),L=>(W(),re(V,{key:L,label:A(m)[L],value:L},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),A(o).listenerType==="classListener"?(W(),re(X,{label:"Java\u7C7B",prop:"class",key:"listener-class",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(oe,{modelValue:A(o).class,"onUpdate:modelValue":N[3]||(N[3]=L=>A(o).class=L),clearable:""},null,8,["modelValue"])]),_:1})):fe("",!0),A(o).listenerType==="expressionListener"?(W(),re(X,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"listener-expression",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(oe,{modelValue:A(o).expression,"onUpdate:modelValue":N[4]||(N[4]=L=>A(o).expression=L),clearable:""},null,8,["modelValue"])]),_:1})):fe("",!0),A(o).listenerType==="delegateExpressionListener"?(W(),re(X,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"listener-delegate",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(oe,{modelValue:A(o).delegateExpression,"onUpdate:modelValue":N[5]||(N[5]=L=>A(o).delegateExpression=L),clearable:""},null,8,["modelValue"])]),_:1})):fe("",!0),A(o).listenerType==="scriptListener"?(W(),pe(Le,{key:3},[T(X,{label:"\u811A\u672C\u683C\u5F0F",prop:"scriptFormat",key:"listener-script-format",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u683C\u5F0F"}},{default:D(()=>[T(oe,{modelValue:A(o).scriptFormat,"onUpdate:modelValue":N[6]||(N[6]=L=>A(o).scriptFormat=L),clearable:""},null,8,["modelValue"])]),_:1}),T(X,{label:"\u811A\u672C\u7C7B\u578B",prop:"scriptType",key:"listener-script-type",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u9009\u62E9\u811A\u672C\u7C7B\u578B"}},{default:D(()=>[T(te,{modelValue:A(o).scriptType,"onUpdate:modelValue":N[7]||(N[7]=L=>A(o).scriptType=L)},{default:D(()=>[T(V,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),T(V,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),A(o).scriptType==="inlineScript"?(W(),re(X,{label:"\u811A\u672C\u5185\u5BB9",prop:"value",key:"listener-script",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u5185\u5BB9"}},{default:D(()=>[T(oe,{modelValue:A(o).value,"onUpdate:modelValue":N[8]||(N[8]=L=>A(o).value=L),clearable:""},null,8,["modelValue"])]),_:1})):fe("",!0),A(o).scriptType==="externalScript"?(W(),re(X,{label:"\u8D44\u6E90\u5730\u5740",prop:"resource",key:"listener-resource",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u8D44\u6E90\u5730\u5740"}},{default:D(()=>[T(oe,{modelValue:A(o).resource,"onUpdate:modelValue":N[9]||(N[9]=L=>A(o).resource=L),clearable:""},null,8,["modelValue"])]),_:1})):fe("",!0)],64)):fe("",!0)]),_:1},8,["model"]),T(H),me("p",cP,[me("span",null,[T(I,{icon:"ep:menu"}),N[21]||(N[21]=ce("\u6CE8\u5165\u5B57\u6BB5\uFF1A"))]),T(U,{type:"primary",onClick:N[10]||(N[10]=L=>S(null)),title:"\u6DFB\u52A0\u5B57\u6BB5"})]),T(q,{data:A(s),size:"small","max-height":"240",fit:"",border:"",style:{flex:"none"}},{default:D(()=>[T(O,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),T(O,{label:"\u5B57\u6BB5\u540D\u79F0","min-width":"100px",prop:"name"}),T(O,{label:"\u5B57\u6BB5\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:L=>A(f)[L.fieldType]},null,8,["formatter"]),T(O,{label:"\u5B57\u6BB5\u503C/\u8868\u8FBE\u5F0F","min-width":"100px","show-overflow-tooltip":"",formatter:L=>L.string||L.expression},null,8,["formatter"]),T(O,{label:"\u64CD\u4F5C",width:"130px"},{default:D(L=>[T(B,{size:"small",link:"",onClick:K=>S(L.row,L.$index)},{default:D(()=>N[22]||(N[22]=[ce("\u7F16\u8F91")])),_:2},1032,["onClick"]),T(H,{direction:"vertical"}),T(B,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:K=>(j=>{Vr.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{s.value.splice(j,1),o.value.fields.splice(j,1)}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(L.$index)},{default:D(()=>N[23]||(N[23]=[ce("\u79FB\u9664")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),me("div",uP,[T(B,{onClick:N[11]||(N[11]=L=>a.value=!1)},{default:D(()=>N[24]||(N[24]=[ce("\u53D6 \u6D88")])),_:1}),T(B,{type:"primary",onClick:l},{default:D(()=>N[25]||(N[25]=[ce("\u4FDD \u5B58")])),_:1})])]),_:1},8,["modelValue","size"]),T(M,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:A(u),"onUpdate:modelValue":N[18]||(N[18]=L=>ze(u)?u.value=L:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:D(()=>[T(B,{size:"small",onClick:N[17]||(N[17]=L=>u.value=!1)},{default:D(()=>N[26]||(N[26]=[ce("\u53D6 \u6D88")])),_:1}),T(B,{size:"small",type:"primary",onClick:k},{default:D(()=>N[27]||(N[27]=[ce("\u786E \u5B9A")])),_:1})]),default:D(()=>[T(ne,{model:A(c),"label-width":"96spx",ref_key:"listenerFieldFormRef",ref:b,style:{height:"136px"}},{default:D(()=>[T(X,{label:"\u5B57\u6BB5\u540D\u79F0\uFF1A",prop:"name",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(oe,{modelValue:A(c).name,"onUpdate:modelValue":N[13]||(N[13]=L=>A(c).name=L),clearable:""},null,8,["modelValue"])]),_:1}),T(X,{label:"\u5B57\u6BB5\u7C7B\u578B\uFF1A",prop:"fieldType",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(te,{modelValue:A(c).fieldType,"onUpdate:modelValue":N[14]||(N[14]=L=>A(c).fieldType=L)},{default:D(()=>[(W(!0),pe(Le,null,We(Object.keys(A(f)),L=>(W(),re(V,{key:L,label:A(f)[L],value:L},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),A(c).fieldType==="string"?(W(),re(X,{label:"\u5B57\u6BB5\u503C\uFF1A",prop:"string",key:"field-string",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(oe,{modelValue:A(c).string,"onUpdate:modelValue":N[15]||(N[15]=L=>A(c).string=L),clearable:""},null,8,["modelValue"])]),_:1})):fe("",!0),A(c).fieldType==="expression"?(W(),re(X,{label:"\u8868\u8FBE\u5F0F\uFF1A",prop:"expression",key:"field-expression",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(oe,{modelValue:A(c).expression,"onUpdate:modelValue":N[16]||(N[16]=L=>A(c).expression=L),clearable:""},null,8,["modelValue"])]),_:1})):fe("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])]),T(ux,{ref_key:"processListenerDialogRef",ref:h,onSelect:x},null,512)],64)}}}),dP={class:"panel-tab__content"},hP={class:"element-drawer__button"},mP=et({name:"ElementProperties",__name:"ElementProperties",props:{id:String,type:String},setup(e){const t=e,n=ln("prefix"),i=F([]),r=F({}),o=F(-1),a=F(!1),s=F(),c=F(),u=F(),p=F(),d=F(),m=()=>window==null?void 0:window.bpmnInstances,f=()=>{var _,b,w;s.value=m().bpmnElement,c.value=[],u.value=((w=(b=(_=s.value.businessObject)==null?void 0:_.extensionElements)==null?void 0:b.values)==null?void 0:w.filter(S=>(S.$type!==`${n}:Properties`&&c.value.push(S),S.$type===`${n}:Properties`)))??[],p.value=u.value.reduce((S,k)=>S.concat(k.values),[]),i.value=JSON.parse(JSON.stringify(p.value??[]))},v=(_,b)=>{o.value=b,r.value=b===-1?{}:JSON.parse(JSON.stringify(_)),a.value=!0,it(()=>{d.value&&d.value.clearValidate()})},g=()=>{console.log(r.value,"propertyForm.value");const{name:_,value:b}=r.value;if(o.value!==-1)m().modeling.updateModdleProperties(Te(s.value),Te(p.value)[Te(o.value)],{name:_,value:b});else{const w=m().moddle.create(`${n}:Property`,{name:_,value:b}),S=m().moddle.create(`${n}:Properties`,{values:p.value.concat([w])});E(S)}a.value=!1,f()},E=_=>{const b=m().moddle.create("bpmn:ExtensionElements",{values:c.value.concat([_])});m().modeling.updateProperties(Te(s.value),{extensionElements:b})};return qe(()=>t.id,_=>{_&&_&&_.length&&f()},{immediate:!0}),(_,b)=>{const w=gi,S=on,k=$r,l=bi,h=Jn,y=Jt,x=Nt,C=an,N=tr;return W(),pe("div",dP,[T(l,{data:A(i),"max-height":"240",fit:"",border:""},{default:D(()=>[T(w,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),T(w,{label:"\u5C5E\u6027\u540D",prop:"name","min-width":"100px","show-overflow-tooltip":""}),T(w,{label:"\u5C5E\u6027\u503C",prop:"value","min-width":"100px","show-overflow-tooltip":""}),T(w,{label:"\u64CD\u4F5C",width:"110px"},{default:D(O=>[T(S,{link:"",onClick:B=>v(O.row,O.$index),size:"small"},{default:D(()=>b[5]||(b[5]=[ce(" \u7F16\u8F91 ")])),_:2},1032,["onClick"]),T(k,{direction:"vertical"}),T(S,{link:"",size:"small",style:{color:"#ff4d4f"},onClick:B=>((H,q)=>{console.log(H,"attr"),Vr.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5C5E\u6027\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{i.value.splice(q,1),p.value.splice(q,1);const U=m().moddle.create(`${n}:Properties`,{values:p.value});E(U),f()}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(O.row,O.$index)},{default:D(()=>b[6]||(b[6]=[ce(" \u79FB\u9664 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),me("div",hP,[T(h,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u5C5E\u6027",onClick:b[0]||(b[0]=O=>v(null,-1))})]),T(N,{modelValue:A(a),"onUpdate:modelValue":b[4]||(b[4]=O=>ze(a)?a.value=O:null),title:"\u5C5E\u6027\u914D\u7F6E",width:"600px","append-to-body":"","destroy-on-close":""},{footer:D(()=>[T(S,{onClick:b[3]||(b[3]=O=>a.value=!1)},{default:D(()=>b[7]||(b[7]=[ce("\u53D6 \u6D88")])),_:1}),T(S,{type:"primary",onClick:g},{default:D(()=>b[8]||(b[8]=[ce("\u786E \u5B9A")])),_:1})]),default:D(()=>[T(C,{model:A(r),"label-width":"80px",ref_key:"attributeFormRef",ref:d},{default:D(()=>[T(x,{label:"\u5C5E\u6027\u540D\uFF1A",prop:"name"},{default:D(()=>[T(y,{modelValue:A(r).name,"onUpdate:modelValue":b[1]||(b[1]=O=>A(r).name=O),clearable:""},null,8,["modelValue"])]),_:1}),T(x,{label:"\u5C5E\u6027\u503C\uFF1A",prop:"value"},{default:D(()=>[T(y,{modelValue:A(r).value,"onUpdate:modelValue":b[2]||(b[2]=O=>A(r).value=O),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),fP={class:"panel-tab__content"},vP={class:"element-drawer__button"},yP={class:"listener-filed__title"},gP={class:"element-drawer__button"},bP=et({name:"UserTaskListeners",__name:"UserTaskListeners",props:{id:String,type:String},setup(e){const t=e,n=ln("prefix"),i=ln("width"),r=F([]),o=F(aP),a=F(lx),s=F(!1),c=F({}),u=F(cx),p=F([]),d=F(!1),m=F(-1),f=F(-1),v=F({}),g=F(),E=F(),_=F(),b=F(),w=F(),S=()=>window==null?void 0:window.bpmnInstances,k=(O,B)=>{O?(c.value=ox(O),m.value=B):(c.value={},m.value=-1),O&&O.fields?p.value=O.fields.map(H=>({...H,fieldType:H.string?"string":"expression"})):(p.value=[],c.value.fields=[]),s.value=!0,it(()=>{b.value&&b.value.clearValidate()})},l=async()=>{var B,H,q;if(!await b.value.validate())return;const O=Ac(c.value,!0,n);m.value===-1?(E.value.push(O),r.value.push(c.value)):(E.value.splice(m.value,1,O),r.value.splice(m.value,1,c.value)),_.value=((q=(H=(B=g.value.businessObject)==null?void 0:B.extensionElements)==null?void 0:H.values)==null?void 0:q.filter(U=>U.$type!==`${n}:TaskListener`))??[],Ro(g.value,_.value.concat(E.value)),s.value=!1,c.value={}},h=(O,B)=>{v.value=O?JSON.parse(JSON.stringify(O)):{},f.value=O?B:-1,d.value=!0,it(()=>{w.value&&w.value.clearValidate()})},y=async()=>{await w.value.validate()&&(f.value===-1?(p.value.push(v.value),c.value.fields.push(v.value)):(p.value.splice(f.value,1,v.value),c.value.fields.splice(f.value,1,v.value)),d.value=!1,it(()=>{v.value={}}))},x=F(),C=async()=>{x.value.open("task")},N=O=>{var q,U,V;const B=sx(O),H=Ac(B,!0,n);E.value.push(H),r.value.push(B),_.value=((V=(U=(q=g.value.businessObject)==null?void 0:q.extensionElements)==null?void 0:U.values)==null?void 0:V.filter(te=>te.$type!==`${n}:TaskListener`))??[],Ro(g.value,_.value.concat(E.value))};return qe(()=>t.id,O=>{O&&O.length&&it(()=>{var B,H;console.log(S().bpmnElement,"window.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElement"),g.value=S().bpmnElement,_.value=[],E.value=((H=(B=g.value.businessObject)==null?void 0:B.extensionElements)==null?void 0:H.values.filter(q=>q.$type===`${n}:TaskListener`))??[],r.value=E.value.map(q=>ax(q))})},{immediate:!0}),(O,B)=>{const H=gi,q=on,U=$r,V=bi,te=Jn,X=Cn,oe=kn,ne=Nt,I=Jt,R=an,M=Mo,L=Ih,K=tr;return W(),pe(Le,null,[me("div",fP,[T(V,{data:A(r),size:"small",border:""},{default:D(()=>[T(H,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),T(H,{label:"\u4E8B\u4EF6\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:j=>A(o)[j.event]},null,8,["formatter"]),T(H,{label:"\u4E8B\u4EF6id","min-width":"80px",prop:"id","show-overflow-tooltip":""}),T(H,{label:"\u76D1\u542C\u5668\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:j=>A(a)[j.listenerType]},null,8,["formatter"]),T(H,{label:"\u64CD\u4F5C",width:"90px"},{default:D(j=>[T(q,{size:"small",link:"",onClick:G=>k(j.row,j.$index)},{default:D(()=>B[22]||(B[22]=[ce("\u7F16\u8F91")])),_:2},1032,["onClick"]),T(U,{direction:"vertical"}),T(q,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:G=>((J,Y)=>{console.log(J,"listener"),Vr.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{E.value.splice(Y,1),r.value.splice(Y,1),Ro(g.value,_.value.concat(E.value))}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(j.row,j.$index)},{default:D(()=>B[23]||(B[23]=[ce("\u79FB\u9664")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),me("div",vP,[T(te,{size:"small",type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",onClick:B[0]||(B[0]=j=>k(null))}),T(te,{type:"success",preIcon:"ep:select",title:"\u9009\u62E9\u76D1\u542C\u5668",size:"small",onClick:C})]),T(L,{modelValue:A(s),"onUpdate:modelValue":B[15]||(B[15]=j=>ze(s)?s.value=j:null),title:"\u4EFB\u52A1\u76D1\u542C\u5668",size:`${A(i)}px`,"append-to-body":"","destroy-on-close":""},{default:D(()=>[T(R,{size:"small",model:A(c),"label-width":"96px",ref_key:"listenerFormRef",ref:b},{default:D(()=>[T(ne,{label:"\u4E8B\u4EF6\u7C7B\u578B",prop:"event",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(oe,{modelValue:A(c).event,"onUpdate:modelValue":B[1]||(B[1]=j=>A(c).event=j)},{default:D(()=>[(W(!0),pe(Le,null,We(Object.keys(A(o)),j=>(W(),re(X,{key:j,label:A(o)[j],value:j},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),T(ne,{label:"\u76D1\u542C\u5668ID",prop:"id",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(I,{modelValue:A(c).id,"onUpdate:modelValue":B[2]||(B[2]=j=>A(c).id=j),clearable:""},null,8,["modelValue"])]),_:1}),T(ne,{label:"\u76D1\u542C\u5668\u7C7B\u578B",prop:"listenerType",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(oe,{modelValue:A(c).listenerType,"onUpdate:modelValue":B[3]||(B[3]=j=>A(c).listenerType=j)},{default:D(()=>[(W(!0),pe(Le,null,We(Object.keys(A(a)),j=>(W(),re(X,{key:j,label:A(a)[j],value:j},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),A(c).listenerType==="classListener"?(W(),re(ne,{label:"Java\u7C7B",prop:"class",key:"listener-class",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(I,{modelValue:A(c).class,"onUpdate:modelValue":B[4]||(B[4]=j=>A(c).class=j),clearable:""},null,8,["modelValue"])]),_:1})):fe("",!0),A(c).listenerType==="expressionListener"?(W(),re(ne,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"listener-expression",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(I,{modelValue:A(c).expression,"onUpdate:modelValue":B[5]||(B[5]=j=>A(c).expression=j),clearable:""},null,8,["modelValue"])]),_:1})):fe("",!0),A(c).listenerType==="delegateExpressionListener"?(W(),re(ne,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"listener-delegate",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(I,{modelValue:A(c).delegateExpression,"onUpdate:modelValue":B[6]||(B[6]=j=>A(c).delegateExpression=j),clearable:""},null,8,["modelValue"])]),_:1})):fe("",!0),A(c).listenerType==="scriptListener"?(W(),pe(Le,{key:3},[T(ne,{label:"\u811A\u672C\u683C\u5F0F",prop:"scriptFormat",key:"listener-script-format",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u683C\u5F0F"}},{default:D(()=>[T(I,{modelValue:A(c).scriptFormat,"onUpdate:modelValue":B[7]||(B[7]=j=>A(c).scriptFormat=j),clearable:""},null,8,["modelValue"])]),_:1}),T(ne,{label:"\u811A\u672C\u7C7B\u578B",prop:"scriptType",key:"listener-script-type",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u9009\u62E9\u811A\u672C\u7C7B\u578B"}},{default:D(()=>[T(oe,{modelValue:A(c).scriptType,"onUpdate:modelValue":B[8]||(B[8]=j=>A(c).scriptType=j)},{default:D(()=>[T(X,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),T(X,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),A(c).scriptType==="inlineScript"?(W(),re(ne,{label:"\u811A\u672C\u5185\u5BB9",prop:"value",key:"listener-script",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u5185\u5BB9"}},{default:D(()=>[T(I,{modelValue:A(c).value,"onUpdate:modelValue":B[9]||(B[9]=j=>A(c).value=j),clearable:""},null,8,["modelValue"])]),_:1})):fe("",!0),A(c).scriptType==="externalScript"?(W(),re(ne,{label:"\u8D44\u6E90\u5730\u5740",prop:"resource",key:"listener-resource",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u8D44\u6E90\u5730\u5740"}},{default:D(()=>[T(I,{modelValue:A(c).resource,"onUpdate:modelValue":B[10]||(B[10]=j=>A(c).resource=j),clearable:""},null,8,["modelValue"])]),_:1})):fe("",!0)],64)):fe("",!0),A(c).event==="timeout"?(W(),pe(Le,{key:4},[T(ne,{label:"\u5B9A\u65F6\u5668\u7C7B\u578B",prop:"eventDefinitionType",key:"eventDefinitionType"},{default:D(()=>[T(oe,{modelValue:A(c).eventDefinitionType,"onUpdate:modelValue":B[11]||(B[11]=j=>A(c).eventDefinitionType=j)},{default:D(()=>[T(X,{label:"\u65E5\u671F",value:"date"}),T(X,{label:"\u6301\u7EED\u65F6\u957F",value:"duration"}),T(X,{label:"\u5FAA\u73AF",value:"cycle"}),T(X,{label:"\u65E0",value:"null"})]),_:1},8,["modelValue"])]),_:1}),A(c).eventDefinitionType&&A(c).eventDefinitionType!=="null"?(W(),re(ne,{label:"\u5B9A\u65F6\u5668",prop:"eventTimeDefinitions",key:"eventTimeDefinitions",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u5B9A\u65F6\u5668\u914D\u7F6E"}},{default:D(()=>[T(I,{modelValue:A(c).eventTimeDefinitions,"onUpdate:modelValue":B[12]||(B[12]=j=>A(c).eventTimeDefinitions=j),clearable:""},null,8,["modelValue"])]),_:1})):fe("",!0)],64)):fe("",!0)]),_:1},8,["model"]),T(U),me("p",yP,[me("span",null,[T(M,{icon:"ep:menu"}),B[24]||(B[24]=ce("\u6CE8\u5165\u5B57\u6BB5\uFF1A"))]),T(q,{size:"small",type:"primary",onClick:B[13]||(B[13]=j=>h(null))},{default:D(()=>B[25]||(B[25]=[ce("\u6DFB\u52A0\u5B57\u6BB5")])),_:1})]),T(V,{data:A(p),size:"small","max-height":"240",fit:"",border:"",style:{flex:"none"}},{default:D(()=>[T(H,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),T(H,{label:"\u5B57\u6BB5\u540D\u79F0","min-width":"100px",prop:"name"}),T(H,{label:"\u5B57\u6BB5\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:j=>A(u)[j.fieldType]},null,8,["formatter"]),T(H,{label:"\u5B57\u6BB5\u503C/\u8868\u8FBE\u5F0F","min-width":"100px","show-overflow-tooltip":"",formatter:j=>j.string||j.expression},null,8,["formatter"]),T(H,{label:"\u64CD\u4F5C",width:"100px"},{default:D(j=>[T(q,{size:"small",link:"",onClick:G=>h(j.row,j.$index)},{default:D(()=>B[26]||(B[26]=[ce("\u7F16\u8F91")])),_:2},1032,["onClick"]),T(U,{direction:"vertical"}),T(q,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:G=>((J,Y)=>{console.log(J,"field"),Vr.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{p.value.splice(Y,1),c.value.fields.splice(Y,1)}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(j.row,j.$index)},{default:D(()=>B[27]||(B[27]=[ce("\u79FB\u9664")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),me("div",gP,[T(q,{size:"small",onClick:B[14]||(B[14]=j=>s.value=!1)},{default:D(()=>B[28]||(B[28]=[ce("\u53D6 \u6D88")])),_:1}),T(q,{size:"small",type:"primary",onClick:l},{default:D(()=>B[29]||(B[29]=[ce("\u4FDD \u5B58")])),_:1})])]),_:1},8,["modelValue","size"]),T(K,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:A(d),"onUpdate:modelValue":B[21]||(B[21]=j=>ze(d)?d.value=j:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:D(()=>[T(q,{size:"small",onClick:B[20]||(B[20]=j=>d.value=!1)},{default:D(()=>B[30]||(B[30]=[ce("\u53D6 \u6D88")])),_:1}),T(q,{size:"small",type:"primary",onClick:y},{default:D(()=>B[31]||(B[31]=[ce("\u786E \u5B9A")])),_:1})]),default:D(()=>[T(R,{model:A(v),size:"small","label-width":"96px",ref_key:"listenerFieldFormRef",ref:w,style:{height:"136px"}},{default:D(()=>[T(ne,{label:"\u5B57\u6BB5\u540D\u79F0\uFF1A",prop:"name",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(I,{modelValue:A(v).name,"onUpdate:modelValue":B[16]||(B[16]=j=>A(v).name=j),clearable:""},null,8,["modelValue"])]),_:1}),T(ne,{label:"\u5B57\u6BB5\u7C7B\u578B\uFF1A",prop:"fieldType",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(oe,{modelValue:A(v).fieldType,"onUpdate:modelValue":B[17]||(B[17]=j=>A(v).fieldType=j)},{default:D(()=>[(W(!0),pe(Le,null,We(Object.keys(A(u)),j=>(W(),re(X,{key:j,label:A(u)[j],value:j},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),A(v).fieldType==="string"?(W(),re(ne,{label:"\u5B57\u6BB5\u503C\uFF1A",prop:"string",key:"field-string",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(I,{modelValue:A(v).string,"onUpdate:modelValue":B[18]||(B[18]=j=>A(v).string=j),clearable:""},null,8,["modelValue"])]),_:1})):fe("",!0),A(v).fieldType==="expression"?(W(),re(ne,{label:"\u8868\u8FBE\u5F0F\uFF1A",prop:"expression",key:"field-expression",rules:{required:!0,trigger:["blur","change"]}},{default:D(()=>[T(I,{modelValue:A(v).expression,"onUpdate:modelValue":B[19]||(B[19]=j=>A(v).expression=j),clearable:""},null,8,["modelValue"])]),_:1})):fe("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])]),T(ux,{ref_key:"processListenerDialogRef",ref:x,onSelect:N},null,512)],64)}}}),Tc=et({name:"MyPropertiesPanel",__name:"PropertiesPanel",props:{bpmnModeler:{type:Object,default:()=>{}},prefix:{type:String,default:"camunda"},width:{type:Number,default:480},idEditDisabled:{type:Boolean,default:!1},model:Object},setup(e){const t=e,n=F("base"),i=F(""),r=F(""),o=F({}),a=F(!1),s=F(!1),c=F(),u=F(!1);Lc("prefix",t.prefix),Lc("width",t.width);const p=()=>window==null?void 0:window.bpmnInstances;qe(()=>t.bpmnModeler,async()=>{if(t.bpmnModeler)try{await it(),(()=>{if(!t.bpmnModeler)return!1;try{const f={modeler:t.bpmnModeler,modeling:t.bpmnModeler.get("modeling"),moddle:t.bpmnModeler.get("moddle"),eventBus:t.bpmnModeler.get("eventBus"),bpmnFactory:t.bpmnModeler.get("bpmnFactory"),elementFactory:t.bpmnModeler.get("elementFactory"),elementRegistry:t.bpmnModeler.get("elementRegistry"),replace:t.bpmnModeler.get("replace"),selection:t.bpmnModeler.get("selection")};return!!Object.values(f).every(v=>v)&&(window.bpmnInstances=f,!0)}catch(f){return console.error("\u521D\u59CB\u5316 bpmnInstances \u5931\u8D25:",f),!1}})()?(u.value=!0,await it(),d()):console.error("modeler \u5B9E\u4F8B\u672A\u5B8C\u5168\u521D\u59CB\u5316")}catch(f){console.error("\u521D\u59CB\u5316\u5931\u8D25:",f)}else console.log("\u7F3A\u5C11props.bpmnModeler")},{immediate:!0});const d=()=>{u.value&&t.bpmnModeler&&(m(null),t.bpmnModeler.on("import.done",f=>{console.log(f,"eeeee"),m(null)}),t.bpmnModeler.on("selection.changed",({newSelection:f})=>{m(f[0]||null)}),t.bpmnModeler.on("element.changed",({element:f})=>{f&&f.id===i.value&&m(f)}))},m=f=>{if(!u.value||!p())return;let v=f;if(v||(v=p().elementRegistry.find(g=>g.type==="bpmn:Process")??p().elementRegistry.find(g=>g.type==="bpmn:Collaboration")),v)try{console.log(`
  257. ----------
  258. select element changed:
  259. id: ${v.id}
  260. type: ${v.businessObject.$type}
  261. ----------
  262. `),console.log("businessObject: ",v.businessObject),p().bpmnElement=v,c.value=v,i.value=v.id,r.value=v.type.split(":")[1]||"",o.value=JSON.parse(JSON.stringify(v.businessObject)),a.value=!(r.value!=="SequenceFlow"||!v.source||v.source.type.indexOf("StartEvent")!==-1),s.value=r.value==="UserTask"||r.value==="StartEvent"}catch(g){console.error("\u521D\u59CB\u5316\u8868\u5355\u6570\u636E\u5931\u8D25:",g)}};return An(()=>{window.bpmnInstances=null,u.value=!1}),qe(()=>i.value,()=>{n.value="base"}),(f,v)=>{const g=Mo,E=_x,_=AT,b=CT,w=Ex;return W(),pe("div",{class:"process-panel__container",style:Bx({width:`${e.width}px`})},[A(u)?(W(),re(w,{key:0,modelValue:A(n),"onUpdate:modelValue":v[0]||(v[0]=S=>ze(n)?n.value=S:null)},{default:D(()=>[T(E,{name:"base"},{title:D(()=>[T(g,{icon:"ep:info-filled"}),v[1]||(v[1]=ce(" \u5E38\u89C4"))]),default:D(()=>[T(MT,{"id-edit-disabled":e.idEditDisabled,"business-object":A(o),type:A(r),model:e.model},null,8,["id-edit-disabled","business-object","type","model"])]),_:1}),A(r)==="Process"?(W(),re(E,{name:"condition",key:"message"},{title:D(()=>[T(g,{icon:"ep:comment"}),v[2]||(v[2]=ce("\u6D88\u606F\u4E0E\u4FE1\u53F7"))]),default:D(()=>[T(rP)]),_:1})):fe("",!0),A(a)?(W(),re(E,{name:"condition",key:"condition"},{title:D(()=>[T(g,{icon:"ep:promotion"}),v[3]||(v[3]=ce("\u6D41\u8F6C\u6761\u4EF6"))]),default:D(()=>[T(eP,{"business-object":A(o),type:A(r)},null,8,["business-object","type"])]),_:1})):fe("",!0),A(s)?(W(),re(E,{name:"condition",key:"form"},{title:D(()=>[T(g,{icon:"ep:list"}),v[4]||(v[4]=ce("\u8868\u5355"))]),default:D(()=>[T(_,{id:A(i),type:A(r)},null,8,["id","type"])]),_:1})):fe("",!0),A(qT)(A(r))?(W(),re(E,{name:"task",key:"task"},{title:D(()=>[T(g,{icon:"ep:checked"}),ce(sn(A(WT)(A(r))),1)]),default:D(()=>[T(XT,{id:A(i),type:A(r)},null,8,["id","type"])]),_:1})):fe("",!0),A(r).indexOf("Task")!==-1?(W(),re(E,{name:"multiInstance",key:"multiInstance"},{title:D(()=>[T(g,{icon:"ep:help-filled"}),v[5]||(v[5]=ce("\u591A\u4EBA\u5BA1\u6279\u65B9\u5F0F"))]),default:D(()=>[T(ZT,{id:A(i),"business-object":A(o),type:A(r)},null,8,["id","business-object","type"])]),_:1})):fe("",!0),T(E,{name:"listeners",key:"listeners"},{title:D(()=>[T(g,{icon:"ep:bell-filled"}),v[6]||(v[6]=ce("\u6267\u884C\u76D1\u542C\u5668"))]),default:D(()=>[T(pP,{id:A(i),type:A(r)},null,8,["id","type"])]),_:1}),A(r)==="UserTask"?(W(),re(E,{name:"taskListeners",key:"taskListeners"},{title:D(()=>[T(g,{icon:"ep:bell-filled"}),v[7]||(v[7]=ce("\u4EFB\u52A1\u76D1\u542C\u5668"))]),default:D(()=>[T(bP,{id:A(i),type:A(r)},null,8,["id","type"])]),_:1})):fe("",!0),T(E,{name:"extensions",key:"extensions"},{title:D(()=>[T(g,{icon:"ep:circle-plus-filled"}),v[8]||(v[8]=ce("\u6269\u5C55\u5C5E\u6027"))]),default:D(()=>[T(mP,{id:A(i),type:A(r)},null,8,["id","type"])]),_:1}),T(E,{name:"other",key:"other"},{title:D(()=>[T(g,{icon:"ep:promotion"}),v[9]||(v[9]=ce("\u5176\u4ED6"))]),default:D(()=>[T(DT,{id:A(i)},null,8,["id"])]),_:1}),T(E,{name:"customConfig",key:"customConfig"},{title:D(()=>[T(g,{icon:"ep:tools"}),v[10]||(v[10]=ce("\u81EA\u5B9A\u4E49\u914D\u7F6E"))]),default:D(()=>[T(b,{id:A(i),type:A(r),"business-object":A(o)},null,8,["id","type","business-object"])]),_:1})]),_:1},8,["modelValue"])):fe("",!0)],4)}}});Tc.install=function(e){e.component(Tc.name,Tc)};var xP=/^djs-cursor-.*$/;function px(e){var t=Ke(document.body);t.removeMatching(xP),e&&t.add("djs-cursor-"+e)}function dx(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _P(e){return e.originalEvent||e.srcEvent}function hx(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 mx(e,t){var n;function i(o){var a,s=n.start,c=n.button,u=hx(o),p=dx(u,s);!n.dragging&&(a=p,Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2))>15)&&(n.dragging=!0,c===0&&function(d,m){m=m||"element.click",d.once(m,5e3,function(){return!1})}(e),px("grab")),n.dragging&&(p=dx(u,n.last||n.start),t.scroll({dx:p.x,dy:p.y}),n.last=u),o.preventDefault()}function r(o){ve.unbind(document,"mousemove",i),ve.unbind(document,"mouseup",r),n=null,px(null)}e.on("element.mousedown",500,function(o){return function(a){if(!Zn(a.target,".djs-draggable")){var s=a.button;if(!(s>=2||a.ctrlKey||a.shiftKey||a.altKey))return n={button:s,start:hx(a)},ve.bind(document,"mousemove",i),ve.bind(document,"mouseup",r),!0}}(o.originalEvent)}),this.isActive=function(){return!!n}}mx.$inject=["eventBus","canvas"];const EP={__init__:["moveCanvas"],moveCanvas:["type",mx]},wP={class:"process-viewer"},SP={style:{position:"absolute",top:"0",left:"0",width:"100%"}},Pc=et({__name:"ProcessViewer",props:{xml:{type:String,required:!0},view:{type:Object,require:!0}},setup(e){const t=e,n=F(),i=F(null),r=F(),o=F(1),a=F(!1),s=F({}),c=F([]),u=F(!1),p=F(void 0),d=F(void 0),m=F([]),f=()=>{n.value&&(n.value.innerHTML=""),i.value&&i.value.destroy(),i.value=null},v=async E=>{if(f(),E!=null&&E!=="")try{i.value=new si({additionalModules:[EP],container:n.value}),i.value.on("element.click",({element:_})=>{(b=>{var S;if(d.value=void 0,p.value=void 0,!b||!((S=s.value)!=null&&S.id))return;const w=b.type;d.value=w,w==="bpmn:UserTask"?(p.value=b.businessObject?b.businessObject.name:void 0,m.value=c.value.filter(k=>(k==null?void 0:k.taskDefinitionKey)===b.id),u.value=!0):w!=="bpmn:EndEvent"&&w!=="bpmn:StartEvent"||(p.value="\u5BA1\u6279\u4FE1\u606F",m.value=[{assigneeUser:s.value.startUser,createTime:s.value.startTime,endTime:s.value.endTime,status:s.value.status,durationInMillis:s.value.durationInMillis}],u.value=!0)})(_)}),a.value=!0,await i.value.importXML(E),(()=>{var w;if(!i.value)return;const _=(w=i.value)==null?void 0:w.get("canvas");(_==null?void 0:_._svg).appendChild(r.value)})()}catch{f()}finally{a.value=!1,g(t.view)}},g=E=>{if(!E||!E.processInstance||(s.value=E.processInstance,c.value=E.tasks,a.value||!i.value))return;const{unfinishedTaskActivityIds:_,finishedTaskActivityIds:b,finishedSequenceFlowActivityIds:w,rejectedTaskActivityIds:S}=E,k=i.value.get("canvas"),l=i.value.get("elementRegistry");Array.isArray(w)&&w.forEach(h=>{h!=null&&(k.addMarker(h,"success"),l.get(h).businessObject.conditionExpression&&k.addMarker(h,"condition-expression"))}),Array.isArray(b)&&b.forEach(h=>k.addMarker(h,"success")),Array.isArray(_)&&_.forEach(h=>k.addMarker(h,"primary")),Array.isArray(S)&&S.forEach(h=>{h!=null&&k.addMarker(h,"danger")}),[Vc.CANCEL,Vc.REJECT].includes(s.value.status)&&l.filter(h=>h.type==="bpmn:EndEvent").forEach(h=>{k.removeMarker(h.id,"success"),s.value.status===Vc.CANCEL?k.addMarker(h.id,"cancel"):k.addMarker(h.id,"danger")})};return qe(()=>t.xml,E=>{v(E)},{immediate:!0}),qe(()=>t.view,E=>{g(E)},{immediate:!0}),nr(()=>{v(t.xml),g(t.view)}),An(()=>{f()}),(E,_)=>{const b=gi,w=Bh,S=bi,k=kx,l=tr,h=on,y=vh;return W(),pe("div",wP,[xi(me("div",{style:{height:"100%"},ref_key:"processCanvas",ref:n},null,512),[[Ja,!A(a)]]),me("defs",{ref_key:"customDefs",ref:r},_[4]||(_[4]=[me("marker",{id:"sequenceflow-end-white-success",viewBox:"0 0 20 20",refX:"11",refY:"10",markerWidth:"10",markerHeight:"10",orient:"auto"},[me("path",{class:"success-arrow",d:"M 1 5 L 11 10 L 1 15 Z",style:{"stroke-width":"1px","stroke-linecap":"round","stroke-dasharray":"10000, 1"}})],-1),me("marker",{id:"conditional-flow-marker-white-success",viewBox:"0 0 20 20",refX:"-1",refY:"10",markerWidth:"10",markerHeight:"10",orient:"auto"},[me("path",{class:"success-conditional",d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",style:{"stroke-width":"1px","stroke-linecap":"round","stroke-dasharray":"10000, 1"}})],-1)]),512),T(l,{title:A(p)||"\u5BA1\u6279\u8BB0\u5F55",modelValue:A(u),"onUpdate:modelValue":_[0]||(_[0]=x=>ze(u)?u.value=x:null),width:"1000px"},{default:D(()=>[T(k,null,{default:D(()=>[T(S,{data:A(m),size:"small",border:"","header-cell-class-name":"table-header-gray"},{default:D(()=>[T(b,{label:"\u5E8F\u53F7","header-align":"center",align:"center",type:"index",width:"50"}),A(d)==="bpmn:UserTask"?(W(),re(b,{key:0,label:"\u5BA1\u6279\u4EBA","min-width":"100",align:"center"},{default:D(x=>{var C,N;return[ce(sn(((C=x.row.assigneeUser)==null?void 0:C.nickname)||((N=x.row.ownerUser)==null?void 0:N.nickname)),1)]}),_:1})):(W(),re(b,{key:1,label:"\u53D1\u8D77\u4EBA",prop:"assigneeUser.nickname","min-width":"100",align:"center"})),T(b,{label:"\u90E8\u95E8","min-width":"100",align:"center"},{default:D(x=>{var C,N;return[ce(sn(((C=x.row.assigneeUser)==null?void 0:C.deptName)||((N=x.row.ownerUser)==null?void 0:N.deptName)),1)]}),_:1}),T(b,{formatter:A(Dh),align:"center",label:"\u5F00\u59CB\u65F6\u95F4",prop:"createTime","min-width":"140"},null,8,["formatter"]),T(b,{formatter:A(Dh),align:"center",label:"\u7ED3\u675F\u65F6\u95F4",prop:"endTime","min-width":"140"},null,8,["formatter"]),T(b,{align:"center",label:"\u5BA1\u6279\u72B6\u6001",prop:"status","min-width":"90"},{default:D(x=>[T(w,{type:A(Oc).BPM_TASK_STATUS,value:x.row.status},null,8,["type","value"])]),_:1}),A(d)==="bpmn:UserTask"?(W(),re(b,{key:2,align:"center",label:"\u5BA1\u6279\u5EFA\u8BAE",prop:"reason","min-width":"120"})):fe("",!0),T(b,{align:"center",label:"\u8017\u65F6",prop:"durationInMillis",width:"100"},{default:D(x=>[ce(sn(A(i_)(x.row.durationInMillis)),1)]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["title","modelValue"]),me("div",SP,[T(k,{type:"flex",justify:"end"},{default:D(()=>[T(y,{key:"scale-control",size:"default"},{default:D(()=>[T(h,{size:"default",plain:!0,disabled:A(o)<=.3,icon:A(wx),onClick:_[1]||(_[1]=x=>((C=.1)=>{var O;let N=Math.floor(100*o.value-100*C)/100;if(N<.2)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be less than 0.2");o.value=N,(O=i.value)==null||O.get("canvas").zoom(o.value)})())},null,8,["disabled","icon"]),T(h,{size:"default",style:{width:"90px"}},{default:D(()=>[ce(sn(Math.floor(10*A(o)*10)+"%"),1)]),_:1}),T(h,{size:"default",plain:!0,disabled:A(o)>=3.9,icon:A(Sx),onClick:_[2]||(_[2]=x=>((C=.1)=>{var O;let N=Math.floor(100*o.value+100*C)/100;if(N>4)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be greater than 4");o.value=N,(O=i.value)==null||O.get("canvas").zoom(o.value)})())},null,8,["disabled","icon"]),T(h,{size:"default",icon:A(Cx),onClick:_[3]||(_[3]=x=>{var C;return o.value=1,void((C=i.value)==null?void 0:C.get("canvas").zoom("fit-viewport","auto"))})},null,8,["icon"])]),_:1})]),_:1})])])}}});Pc.install=function(e){e.component(Pc.name,Pc)};export{ql as P,Pc as _,Ae as a,pi as b,z as c,P as d,wt as e,Ee as f,_P as g,$ as h,Se as i,kc as j,Tc as k};