diff --git a/demo/draw-path/index.html b/demo/draw-path/index.html
index 319999da..e25cf43a 100644
--- a/demo/draw-path/index.html
+++ b/demo/draw-path/index.html
@@ -26,7 +26,7 @@
-
+
@@ -108,7 +108,7 @@
Progress
diff --git a/demo/draw-path/js/path-use-case.js b/demo/draw-path/js/path-use-case.js
index 39e69450..49215f9f 100644
--- a/demo/draw-path/js/path-use-case.js
+++ b/demo/draw-path/js/path-use-case.js
@@ -7,7 +7,7 @@ class PathUseCase extends UseCase {
#pathManager;
constructor(getDiagram) {
- super('path', getDiagram, true);
+ super( {getDiagram, navigationEnabled: true});
this.#steps = new Steps();
}
diff --git a/demo/hacktoberfest-custom-themes/index.html b/demo/hacktoberfest-custom-themes/index.html
index a2b717c0..a89eed6a 100644
--- a/demo/hacktoberfest-custom-themes/index.html
+++ b/demo/hacktoberfest-custom-themes/index.html
@@ -35,7 +35,7 @@
-
+
diff --git a/demo/load-and-navigation/assets/main.js b/demo/load-and-navigation/assets/main.js
index 02dd15d2..fd907c34 100644
--- a/demo/load-and-navigation/assets/main.js
+++ b/demo/load-and-navigation/assets/main.js
@@ -1,11 +1,11 @@
-var Qt=Object.defineProperty;var Jt=(n,e,t)=>e in n?Qt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var g=(n,e,t)=>(Jt(n,typeof e!="symbol"?e+"":e,t),t);import{f as en}from"./mxgraph.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();var ce=(n=>(n.None="None",n.HorizontalVertical="HorizontalVertical",n.Horizontal="Horizontal",n.Vertical="Vertical",n.Center="Center",n))(ce||{}),tn=(n=>(n.In="in",n.Out="out",n))(tn||{});function nn(n){return n instanceof HTMLElement?n:document.querySelector(`#${n}`)}var h=(n=>(n.LANE="lane",n.POOL="pool",n.CALL_ACTIVITY="callActivity",n.SUB_PROCESS="subProcess",n.TASK="task",n.TASK_USER="userTask",n.TASK_SERVICE="serviceTask",n.TASK_RECEIVE="receiveTask",n.TASK_SEND="sendTask",n.TASK_MANUAL="manualTask",n.TASK_SCRIPT="scriptTask",n.TASK_BUSINESS_RULE="businessRuleTask",n.GLOBAL_TASK="globalTask",n.GLOBAL_TASK_USER="globalUserTask",n.GLOBAL_TASK_MANUAL="globalManualTask",n.GLOBAL_TASK_SCRIPT="globalScriptTask",n.GLOBAL_TASK_BUSINESS_RULE="globalBusinessRuleTask",n.GROUP="group",n.TEXT_ANNOTATION="textAnnotation",n.GATEWAY_PARALLEL="parallelGateway",n.GATEWAY_EXCLUSIVE="exclusiveGateway",n.GATEWAY_INCLUSIVE="inclusiveGateway",n.GATEWAY_EVENT_BASED="eventBasedGateway",n.GATEWAY_COMPLEX="complexGateway",n.EVENT_START="startEvent",n.EVENT_END="endEvent",n.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",n.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",n.EVENT_BOUNDARY="boundaryEvent",n))(h||{}),ue=(n=>(n.CALLING_PROCESS="process",n.CALLING_GLOBAL_TASK="global task",n))(ue||{}),de=(n=>(n.Exclusive="Exclusive",n.None="None",n.Parallel="Parallel",n))(de||{}),b=(n=>(n.NONE="none",n.TERMINATE="terminate",n.CANCEL="cancel",n.COMPENSATION="compensate",n.CONDITIONAL="conditional",n.ERROR="error",n.ESCALATION="escalation",n.LINK="link",n.MESSAGE="message",n.SIGNAL="signal",n.TIMER="timer",n))(b||{}),w=(n=>(n.ADHOC="adhoc",n.COMPENSATION="compensation",n.EXPAND="expand",n.LOOP="loop",n.MULTI_INSTANCE_PARALLEL="parallel multi instance",n.MULTI_INSTANCE_SEQUENTIAL="sequential multi instance",n))(w||{}),W=(n=>(n.AD_HOC="ad_hoc",n.EMBEDDED="embedded",n.EVENT="event",n.TRANSACTION="transaction",n))(W||{});function sn(n,e){return n===""?e?{}:void 0:n}function m(n,e=!1){return n==null?[]:(Array.isArray(n)?n:[n]).map(t=>sn(t,e)).filter(Boolean)}function on(n,e,t){const s=[];t!=null&&t.startingWith?s.push(`^(${t.startingWith}).*`):t!=null&&t.notStartingWith&&s.push(`^(?!(${t.notStartingWith})).*`),s.push(`${e}$`);const i=s.join("");return n.filter(o=>t!=null&&t.ignoreCase?new RegExp(i,"i").test(o):new RegExp(i).test(o))}class C{static isEvent(e){return Ee(tt,e)}static eventKinds(){return[...tt]}static isBoundaryEvent(e){return h.EVENT_BOUNDARY===e}static isStartEvent(e){return h.EVENT_START===e}static isCallActivity(e){return h.CALL_ACTIVITY===e}static isSubProcess(e){return h.SUB_PROCESS===e}static canHaveNoneEvent(e){return h.EVENT_INTERMEDIATE_THROW===e||h.EVENT_END===e||h.EVENT_START===e}static isActivity(e){return Ee(ke,e)}static activityKinds(){return[...ke]}static isWithDefaultSequenceFlow(e){return rn.includes(e)}static isTask(e){return Ee(Pe,e)}static taskKinds(){return[...Pe]}static gatewayKinds(){return[...nt]}static isGateway(e){return Ee(nt,e)}static flowNodeKinds(){return Object.values(h).filter(e=>!C.isPoolOrLane(e))}static isPoolOrLane(e){return e==h.POOL||e==h.LANE}}function Ue(n,e){return on(Object.values(h),n,e)}function Ee(n,e){return Object.values(n).map(t=>t).includes(e)}const tt=Ue("Event"),nt=Ue("Gateway"),Pe=Ue("Task",{ignoreCase:!0,notStartingWith:"global"}),ke=[...Pe,h.CALL_ACTIVITY,h.SUB_PROCESS],rn=[...ke,h.GATEWAY_EXCLUSIVE,h.GATEWAY_INCLUSIVE,h.GATEWAY_COMPLEX],mt=Object.values(b).filter(n=>n!=b.NONE);var j=(n=>(n.NONE="None",n.ONE="One",n.BOTH="Both",n))(j||{}),M=(n=>(n.SEQUENCE_FLOW="sequenceFlow",n.MESSAGE_FLOW="messageFlow",n.ASSOCIATION_FLOW="association",n))(M||{}),ge=(n=>(n.NONE="none",n.INITIATING="initiating",n.NON_INITIATING="non_initiating",n))(ge||{}),V=(n=>(n.NORMAL="normal",n.DEFAULT="default",n.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",n.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway",n))(V||{});class ve{constructor(e,t,s,i,o){this.id=e,this.name=t,this.kind=s,this.sourceReferenceId=i,this.targetReferenceId=o}}class It extends ve{constructor(e,t,s,i,o=V.NORMAL){super(e,t,M.SEQUENCE_FLOW,s,i),this.sequenceFlowKind=o}}class Ct extends ve{constructor(e,t,s,i){super(e,t,M.MESSAGE_FLOW,s,i)}}class At extends ve{constructor(e,t,s,i,o=j.NONE){super(e,t,M.ASSOCIATION_FLOW,s,i),this.associationDirectionKind=o}}const L=ln(),v=L.mxCellRenderer,Ot=L.mxClient,c=L.mxConstants,D=L.mxEvent,st=L.mxPerimeter,x=L.mxPoint,xe=L.mxRectangle,We=L.mxRectangleShape,he=L.mxSvgCanvas2D,O=L.mxUtils;function ln(){return window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",en({})}class an{constructor(e){this.graph=e}computeRelativeCoordinates(e,t){const s=this.getTranslateForRoot(e),i=t.x+s.x,o=t.y+s.y;return new x(i,o)}getTranslateForRoot(e){const t=this.graph.getModel(),s=new x(0,0);for(;e!=null;){const i=t.getGeometry(e);i!=null&&(s.x-=i.x,s.y-=i.y),e=t.getParent(e)}return s}computeEdgeCenter(e){const t=e.geometry.points,s=t[0],i=t[t.length-1];if(s!=null&&i!=null){const o=i.x-s.x,r=i.y-s.y;return new x(s.x+o/2,s.y+r/2)}}}class me{constructor(e,t,s,i,o){g(this,"extensions",{});this.id=e,this.bpmnElement=t,this.bounds=s,this.label=i,this.isHorizontal=o}}class Y{constructor(e,t,s,i,o=!1){g(this,"incomingIds",[]);g(this,"outgoingIds",[]);this.id=e,this.name=t,this.kind=s,this.parentId=i,this.instantiate=o}}class Le extends Y{constructor(e,t,s,i,o,r=[]){super(e,t,s,i,o),this.markers=r}}class Z extends Le{constructor(e,t,s,i,o,r){super(e,t,h.CALL_ACTIVITY,i,void 0,o),this.callActivityKind=s,this.globalTaskKind=r}}class fe extends Le{constructor(e,t,s,i,o){s==W.AD_HOC&&!o.includes(w.ADHOC)&&o.push(w.ADHOC),super(e,t,h.SUB_PROCESS,i,void 0,o),this.subProcessKind=s}}class J extends Y{constructor(e,t,s,i,o){super(e,t,s,o),this.eventDefinitionKind=i}}class Nt extends J{constructor(e,t,s,i,o){super(e,t,h.EVENT_START,s,i),this.isInterrupting=o}}class vt extends J{constructor(e,t,s,i,o=!0){super(e,t,h.EVENT_BOUNDARY,s,i),this.isInterrupting=o}}class Lt extends Y{constructor(e,t,s,i,o=de.None){super(e,t,h.GATEWAY_EVENT_BASED,s,i),this.gatewayKind=o}}function Ie(n,e,t,s){return Math.min(Math.max(n??s,e),t)}function cn(n){return Math.max(n??0,0)}function un(n){const e=n??{};return e.debounceDelay=Ie(e.debounceDelay,0,100,50),e.throttleDelay=Ie(e.throttleDelay,0,100,50),e}function ye(n){return n=="default"?void 0:Ie(n,0,100,100)}function dn(n){return n=="default"?void 0:Ie(n,1,50,1)}const I={EDGE:"bpmn.edge",EDGE_START_FILL_COLOR:"bpmn.edge.startFillColor",EDGE_END_FILL_COLOR:"bpmn.edge.endFillColor",EVENT_BASED_GATEWAY_KIND:"bpmn.gatewayKind",EVENT_DEFINITION_KIND:"bpmn.eventDefinitionKind",GLOBAL_TASK_KIND:"bpmn.globalTaskKind",SUB_PROCESS_KIND:"bpmn.subProcessKind",IS_INITIATING:"bpmn.isInitiating",IS_INSTANTIATING:"bpmn.isInstantiating",IS_INTERRUPTING:"bpmn.isInterrupting",EXTRA_CSS_CLASSES:"bpmn.extra.css.classes",MARKERS:"bpmn.markers",MESSAGE_FLOW_ICON:"bpmn.messageFlowIcon"},yt={ARROW_DASH:"bpmn.dash"},p={STROKE_WIDTH_THIN:2,STROKE_WIDTH_THICK:5,SHAPE_ACTIVITY_BOTTOM_MARGIN:7,SHAPE_ACTIVITY_TOP_MARGIN:7,SHAPE_ACTIVITY_LEFT_MARGIN:7,SHAPE_ACTIVITY_FROM_CENTER_MARGIN:7,SHAPE_ACTIVITY_MARKER_ICON_MARGIN:5,SHAPE_ACTIVITY_MARKER_ICON_SIZE:20,POOL_LABEL_SIZE:30,POOL_LABEL_FILL_COLOR:"none",LANE_LABEL_SIZE:30,LANE_LABEL_FILL_COLOR:"none",SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET:4,SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE:6,TEXT_ANNOTATION_BORDER_LENGTH:10,TEXT_ANNOTATION_FILL_COLOR:"none",GROUP_FILL_COLOR:"none",DEFAULT_FILL_COLOR:"White",DEFAULT_STROKE_COLOR:"Black",DEFAULT_FONT_FAMILY:"Arial, Helvetica, sans-serif",DEFAULT_FONT_SIZE:11,DEFAULT_FONT_COLOR:"Black",DEFAULT_MARGIN:0,SHAPE_ARC_SIZE:20,DEFAULT_OVERLAY_FILL_COLOR:"White",DEFAULT_OVERLAY_FILL_OPACITY:100,DEFAULT_OVERLAY_STROKE_COLOR:"Black",DEFAULT_OVERLAY_STROKE_WIDTH:1,DEFAULT_OVERLAY_FONT_SIZE:11,DEFAULT_OVERLAY_FONT_COLOR:"Black",SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_START_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_END_FILL_COLOR:"White"},_t=n=>O.getValue(n,I.IS_INSTANTIATING,"false")=="true",Ce=n=>n=="default"?void 0:n,hn=(n,e)=>(e&&(n=F(n,c.STYLE_STROKECOLOR,e.color,Ce),n=F(n,c.STYLE_STROKE_OPACITY,e.opacity,ye),n=F(n,c.STYLE_STROKEWIDTH,e.width,dn)),n),F=(n,e,t,s=i=>i)=>t==null?n:O.setStyle(n,e,s(t)),Se=(n,e,t,s)=>s==null?n:O.setStyleFlag(n,e,t,s),fn=(n,e)=>(e&&(n=F(n,c.STYLE_FONTCOLOR,e.color,Ce),n=F(n,c.STYLE_FONTSIZE,e.size),n=F(n,c.STYLE_FONTFAMILY,e.family),n=Se(n,c.STYLE_FONTSTYLE,c.FONT_BOLD,e.isBold),n=Se(n,c.STYLE_FONTSTYLE,c.FONT_ITALIC,e.isItalic),n=Se(n,c.STYLE_FONTSTYLE,c.FONT_UNDERLINE,e.isUnderline),n=Se(n,c.STYLE_FONTSTYLE,c.FONT_STRIKETHROUGH,e.isStrikeThrough),n=F(n,c.STYLE_TEXT_OPACITY,e.opacity,ye)),n),gn=(n,e,t)=>(n==null?void 0:n.split(";").map(s=>s.split("=")).filter(([s])=>s===e).map(([,s])=>s)[0])??t,Tn=n=>{switch(n){case"right-to-left":return c.DIRECTION_WEST;case"bottom-to-top":return c.DIRECTION_NORTH;case"top-to-bottom":return c.DIRECTION_SOUTH;default:return c.DIRECTION_EAST}},pn=(n,e)=>{const t=e.color;if(t){const s=Sn(t),i=s?t.startColor:t;n=F(n,c.STYLE_FILLCOLOR,i,Ce),s?(n=O.setStyle(n,c.STYLE_GRADIENTCOLOR,t.endColor),n=O.setStyle(n,c.STYLE_GRADIENT_DIRECTION,Tn(t.direction))):t==="default"&&(n=O.setStyle(n,c.STYLE_GRADIENTCOLOR,void 0),n=O.setStyle(n,c.STYLE_GRADIENT_DIRECTION,void 0)),(n.includes(h.POOL)||n.includes(h.LANE))&&(n=F(n,c.STYLE_SWIMLANE_FILLCOLOR,i,Ce))}return n=F(n,c.STYLE_FILL_OPACITY,e.opacity,ye),n},En=n=>n&&typeof n=="object"&&"fill"in n,Sn=n=>n&&typeof n=="object";class q{constructor(e){g(this,"ignoreBpmnColors");this.ignoreBpmnColors=(e==null?void 0:e.ignoreBpmnColors)??!0}computeStyle(e,t){const s=[e.bpmnElement.kind];let i;e instanceof me?i=this.computeShapeStyleValues(e):(s.push(...q.computeEdgeBaseStyles(e)),i=this.computeEdgeStyleValues(e));const o=this.computeFontStyleValues(e),r=q.computeLabelStyleValues(e,t);return s.push(...it([...i,...o,...r])),s.join(";")}computeShapeStyleValues(e){const t=new Map,s=e.bpmnElement;if(s instanceof J?q.computeEventShapeStyle(s,t):s instanceof Le?q.computeActivityShapeStyle(s,t):C.isPoolOrLane(s.kind)?t.set(c.STYLE_HORIZONTAL,e.isHorizontal?"0":"1"):s instanceof Lt&&(t.set(I.IS_INSTANTIATING,String(s.instantiate)),t.set(I.EVENT_BASED_GATEWAY_KIND,String(s.gatewayKind))),!this.ignoreBpmnColors){const i=e.extensions,o=i.fillColor;o&&(t.set(c.STYLE_FILLCOLOR,o),C.isPoolOrLane(s.kind)&&t.set(c.STYLE_SWIMLANE_FILLCOLOR,o)),i.strokeColor&&t.set(c.STYLE_STROKECOLOR,i.strokeColor)}return t}static computeEventShapeStyle(e,t){t.set(I.EVENT_DEFINITION_KIND,e.eventDefinitionKind),(e instanceof vt||e instanceof Nt&&e.isInterrupting!==void 0)&&t.set(I.IS_INTERRUPTING,String(e.isInterrupting))}static computeActivityShapeStyle(e,t){e instanceof fe?t.set(I.SUB_PROCESS_KIND,e.subProcessKind):e.kind===h.TASK_RECEIVE?t.set(I.IS_INSTANTIATING,String(e.instantiate)):e instanceof Z&&t.set(I.GLOBAL_TASK_KIND,e.globalTaskKind);const s=e.markers;s.length>0&&t.set(I.MARKERS,s.join(","))}static computeEdgeBaseStyles(e){const t=[],s=e.bpmnElement;return s instanceof It&&t.push(s.sequenceFlowKind),s instanceof At&&t.push(s.associationDirectionKind),t}computeEdgeStyleValues(e){const t=new Map;if(!this.ignoreBpmnColors){const s=e.extensions;s.strokeColor&&t.set(c.STYLE_STROKECOLOR,s.strokeColor)}return t}computeFontStyleValues(e){var i,o;const t=new Map,s=(i=e.label)==null?void 0:i.font;if(s&&(t.set(c.STYLE_FONTFAMILY,s.name),t.set(c.STYLE_FONTSIZE,s.size),t.set(c.STYLE_FONTSTYLE,mn(s))),!this.ignoreBpmnColors){const r=(o=e.label)==null?void 0:o.extensions;r!=null&&r.color&&t.set(c.STYLE_FONTCOLOR,r.color)}return t}static computeLabelStyleValues(e,t){const s=new Map,i=e.bpmnElement;return t?(s.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),e.bpmnElement.kind!=h.TEXT_ANNOTATION&&s.set(c.STYLE_ALIGN,c.ALIGN_CENTER),e instanceof me&&(s.set(c.STYLE_LABEL_WIDTH,t.width+1),s.set(c.STYLE_LABEL_POSITION,"ignore"),s.set(c.STYLE_VERTICAL_LABEL_POSITION,c.ALIGN_MIDDLE))):e instanceof me&&(i instanceof fe||i instanceof Z&&i.callActivityKind===ue.CALLING_PROCESS)&&!i.markers.includes(w.EXPAND)&&s.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),s}computeMessageFlowIconStyle(e){const t=[];return t.push(["shape",I.MESSAGE_FLOW_ICON],[I.IS_INITIATING,String(e.messageVisibleKind===ge.INITIATING)]),this.ignoreBpmnColors||e.extensions.strokeColor&&t.push([c.STYLE_STROKECOLOR,e.extensions.strokeColor]),it(t).join(";")}}function mn(n){let e=0;return n.isBold&&(e+=c.FONT_BOLD),n.isItalic&&(e+=c.FONT_ITALIC),n.isStrikeThrough&&(e+=c.FONT_STRIKETHROUGH),n.isUnderline&&(e+=c.FONT_UNDERLINE),e}function it(n){return n.filter(([,e])=>e&&e!="undefined").map(([e,t])=>`${e}=${t}`)}class In{constructor(e,t,s){this.graph=e,this.coordinatesTranslator=t,this.styleComputer=s}render(e,t){this.insertShapesAndEdges(e),this.graph.customFit(t)}insertShapesAndEdges({pools:e,lanes:t,subprocesses:s,otherFlowNodes:i,boundaryEvents:o,edges:r}){this.graph.batchUpdate(()=>{this.graph.getModel().clear(),this.insertShapes(e),this.insertShapes(t),this.insertShapes(s),this.insertShapes(i),this.insertShapes(o),this.insertEdges(r)})}insertShapes(e){for(const t of e)this.insertShape(t)}getParent(e){return this.getCell(e.parentId)??this.graph.getDefaultParent()}insertShape(e){var l;const t=e.bpmnElement,s=this.getParent(t),i=e.bounds;let o=(l=e.label)==null?void 0:l.bounds;o=C.isPoolOrLane(t.kind)?void 0:o;const r=this.styleComputer.computeStyle(e,o);this.insertVertex(s,t.id,t.name,i,o,r)}insertEdges(e){var t;for(const s of e){const i=s.bpmnElement,o=this.graph.getDefaultParent(),r=this.getCell(i.sourceReferenceId),l=this.getCell(i.targetReferenceId),a=(t=s.label)==null?void 0:t.bounds,u=this.styleComputer.computeStyle(s,a),d=this.graph.insertEdge(o,i.id,i.name,r,l,u);if(this.insertWaypoints(s.waypoints,d),a){d.geometry.width=a.width,d.geometry.height=a.height;const f=this.coordinatesTranslator.computeEdgeCenter(d);if(f){d.geometry.relative=!1;const T=this.coordinatesTranslator.computeRelativeCoordinates(d.parent,new x(a.x,a.y)),E=T.x+a.width/2-f.x,S=T.y-f.y;d.geometry.offset=new x(E,S)}}this.insertMessageFlowIconIfNeeded(s,d)}}insertMessageFlowIconIfNeeded(e,t){if(e.bpmnElement instanceof Ct&&e.messageVisibleKind!==ge.NONE){const s=this.graph.insertVertex(t,De(t.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(e));s.geometry.relative=!0,s.geometry.offset=new x(-10,-7)}}insertWaypoints(e,t){e&&(t.geometry.points=e.map(s=>this.coordinatesTranslator.computeRelativeCoordinates(t.parent,new x(s.x,s.y))))}getCell(e){return this.graph.getModel().getCell(e)}insertVertex(e,t,s,i,o,r){const l=this.coordinatesTranslator.computeRelativeCoordinates(e,new x(i.x,i.y)),a=this.graph.insertVertex(e,t,s,l.x,l.y,i.width,i.height,r);if(o){const u=o.x-i.x,d=o.y-i.y;a.geometry.offset=new x(u,d)}return a}}function Cn(n,e){return new In(n,new an(n),new q(e))}function De(n){return`messageFlowIcon_of_${n}`}var An=typeof global=="object"&&global&&global.Object===Object&&global;const On=An;var Nn=typeof self=="object"&&self&&self.Object===Object&&self,vn=On||Nn||Function("return this")();const wt=vn;var Ln=wt.Symbol;const Ae=Ln;var bt=Object.prototype,yn=bt.hasOwnProperty,_n=bt.toString,re=Ae?Ae.toStringTag:void 0;function wn(n){var e=yn.call(n,re),t=n[re];try{n[re]=void 0;var s=!0}catch{}var i=_n.call(n);return s&&(e?n[re]=t:delete n[re]),i}var bn=Object.prototype,Rn=bn.toString;function Fn(n){return Rn.call(n)}var Pn="[object Null]",kn="[object Undefined]",ot=Ae?Ae.toStringTag:void 0;function xn(n){return n==null?n===void 0?kn:Pn:ot&&ot in Object(n)?wn(n):Fn(n)}function Mn(n){return n!=null&&typeof n=="object"}var Bn="[object Symbol]";function Gn(n){return typeof n=="symbol"||Mn(n)&&xn(n)==Bn}var Vn=/\s/;function Yn(n){for(var e=n.length;e--&&Vn.test(n.charAt(e)););return e}var Un=/^\s+/;function Wn(n){return n&&n.slice(0,Yn(n)+1).replace(Un,"")}function Oe(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var rt=0/0,Dn=/^[-+]0x[0-9a-f]+$/i,Hn=/^0b[01]+$/i,Kn=/^0o[0-7]+$/i,zn=parseInt;function lt(n){if(typeof n=="number")return n;if(Gn(n))return rt;if(Oe(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Oe(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Wn(n);var t=Hn.test(n);return t||Kn.test(n)?zn(n.slice(2),t?2:8):Dn.test(n)?rt:+n}var Xn=function(){return wt.Date.now()};const be=Xn;var $n="Expected a function",Zn=Math.max,jn=Math.min;function Rt(n,e,t){var s,i,o,r,l,a,u=0,d=!1,f=!1,T=!0;if(typeof n!="function")throw new TypeError($n);e=lt(e)||0,Oe(t)&&(d=!!t.leading,f="maxWait"in t,o=f?Zn(lt(t.maxWait)||0,e):o,T="trailing"in t?!!t.trailing:T);function E(_){var U=s,oe=i;return s=i=void 0,u=_,r=n.apply(oe,U),r}function S(_){return u=_,l=setTimeout(pe,e),d?E(_):r}function B(_){var U=_-a,oe=_-u,et=e-U;return f?jn(et,o-oe):et}function P(_){var U=_-a,oe=_-u;return a===void 0||U>=e||U<0||f&&oe>=o}function pe(){var _=be();if(P(_))return Je(_);l=setTimeout(pe,B(_))}function Je(_){return l=void 0,T&&s?E(_):(s=i=void 0,r)}function jt(){l!==void 0&&clearTimeout(l),u=0,s=a=i=l=void 0}function qt(){return l===void 0?r:Je(be())}function we(){var _=be(),U=P(_);if(s=arguments,i=this,a=_,U){if(l===void 0)return S(a);if(f)return clearTimeout(l),l=setTimeout(pe,e),E(a)}return l===void 0&&(l=setTimeout(pe,e)),r}return we.cancel=jt,we.flush=qt,we}var qn="Expected a function";function Qn(n,e,t){var s=!0,i=!0;if(typeof n!="function")throw new TypeError(qn);return Oe(t)&&(s="leading"in t?!!t.leading:s,i="trailing"in t?!!t.trailing:i),Rt(n,e,{leading:s,maxWait:e,trailing:i})}class Ft extends L.mxCellOverlay{constructor(t,s){super(null,"",s.position.horizontalAlign,s.position.verticalAlign,null,"default");g(this,"style");this.label=t,this.style=s.style}getBounds(t){const s=t.view.graph.getModel().isEdge(t.cell),i=t.view.scale;let o;const r=0,l=0;return s?o=this.computeEdgeBounds(t):(o=new x,this.align==c.ALIGN_LEFT?o.x=t.x:this.align==c.ALIGN_CENTER?o.x=t.x+t.width/2:o.x=t.x+t.width,this.verticalAlign==c.ALIGN_TOP?o.y=t.y:this.verticalAlign==c.ALIGN_MIDDLE?o.y=t.y+t.height/2:o.y=t.y+t.height),new xe(Math.round(o.x-(r*this.defaultOverlap-this.offset.x)*i),Math.round(o.y-(l*this.defaultOverlap-this.offset.y)*i),r*i,l*i)}computeEdgeBounds(t){const s=t.absolutePoints;if(this.align==c.ALIGN_LEFT)return s[0];if(this.align==c.ALIGN_CENTER){if(s.length%2==1)return s[Math.floor(s.length/2)];{const i=s.length/2,o=s[i-1],r=s[i];return new x(o.x+(r.x-o.x)/2,o.y+(r.y-o.y)/2)}}else return s[s.length-1]}}class at extends L.mxText{constructor(e,t,s){super(e,t,void 0,void 0,s.font.color,void 0,s.font.size,void 0,void 0,void 0,void 0,void 0,void 0,void 0,s.fill.color,s.stroke.color),this.fillOpacity=s.fill.opacity,this.strokewidth=s.stroke.width}}class Jn extends L.mxCellRenderer{createCellOverlays(e){const s=e.view.graph.getCellOverlays(e.cell);let i=null;if(s!=null){i=new L.mxDictionary;for(const o of s){const r=e.overlays==null?null:e.overlays.remove(o);if(r!=null){i.put(o,r);continue}let l;o instanceof Ft?l=new at(o.label,new xe(0,0,0,0),o.style):(l=new L.mxImageShape(new xe(0,0,0,0),o.image.src),l.preserveImageAspect=!1),l.dialect=e.view.graph.dialect,l.overlay=o,this.initializeOverlay(e,l),this.installCellOverlayListeners(e,o,l),o.cursor!=null&&(l.node.style.cursor=o.cursor),l instanceof at&&(l.node.classList.add("overlay-badge"),l.node.setAttribute("data-bpmn-id",e.cell.id)),i.put(o,l)}}e.overlays!=null&&e.overlays.visit(function(o,r){r.destroy()}),e.overlays=i}}const Me=1.25,es=1/Me;class ts extends L.mxGraph{constructor(t){super(t);g(this,"currentZoomLevel",1);this.zoomFactor=Me,this.container&&(this.container.style.cursor="default")}createGraphView(){return new ns(this)}createCellRenderer(){return new Jn}batchUpdate(t){this.model.beginUpdate();try{t()}finally{this.model.endUpdate()}}fit(t,s,i,o,r,l,a){const u=super.fit(t,s,i,o,r,l,a);return this.setCurrentZoomLevel(u),u}setCurrentZoomLevel(t){this.currentZoomLevel=t??this.view.scale}zoomActual(){super.zoomActual(),this.setCurrentZoomLevel()}zoomIn(){super.zoomIn(),this.setCurrentZoomLevel()}zoomOut(){super.zoomOut(),this.setCurrentZoomLevel()}customFit(t){this.zoomActual();const s=t==null?void 0:t.type;if(s==null||s==ce.None)return;const i=cn(t==null?void 0:t.margin);if(s==ce.Center){const r=this.getGraphBounds(),l=this.container.clientWidth-i,a=this.container.clientHeight-i,u=r.width/this.view.scale,d=r.height/this.view.scale,f=Math.min(3,Math.min(l/u,a/d));this.setCurrentZoomLevel(f),this.view.scaleAndTranslate(f,(i+l-u*f)/(2*f)-r.x/this.view.scale,(i+a-d*f)/(2*f)-r.y/this.view.scale)}else{let o=!1,r=!1;switch(s){case ce.Horizontal:{r=!0;break}case ce.Vertical:{o=!0;break}}this.fit(this.border,!1,i,!0,o,r)}}registerMouseWheelZoomListeners(t){t=un(t),D.addMouseWheelListener(Rt(this.createMouseWheelZoomListener(!0),t.debounceDelay),this.container),D.addMouseWheelListener(Qn(this.createMouseWheelZoomListener(!1),t.throttleDelay),this.container)}manageMouseWheelZoomEvent(t,s,i){if(i){const[o,r]=this.getEventRelativeCoordinates(s),[l,a,u]=this.getScaleAndTranslationDeltas(o,r);this.view.scaleAndTranslate(l,this.view.translate.x+a,this.view.translate.y+u),D.consume(s)}else this.currentZoomLevel*=t?Me:es}createMouseWheelZoomListener(t){return(s,i)=>{if(D.isConsumed(s)||!(s instanceof MouseEvent))return;s.ctrlKey&&!s.altKey&&!s.shiftKey&&!s.metaKey&&this.manageMouseWheelZoomEvent(i,s,t)}}getEventRelativeCoordinates(t){const s=this.container.getBoundingClientRect(),i=t.clientX-s.left,o=t.clientY-s.top;return[i,o]}getScaleAndTranslationDeltas(t,s){const[i,o]=this.calculateFactorAndScale(),[r,l]=this.calculateTranslationDeltas(i,o,t*2,s*2);return[o,r,l]}calculateTranslationDeltas(t,s,i,o){if(t>1){const r=(t-1)/(s*2);i*=-r,o*=-r}else{const r=(1/t-1)/(this.view.scale*2);i*=r,o*=r}return[i,o]}calculateFactorAndScale(){const t=Math.round(this.currentZoomLevel*100)/100;return[t/this.view.scale,t]}}class ns extends L.mxGraphView{getFloatingTerminalPoint(e,t,s,i){if(e.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(e,t,s,i);const l=e.absolutePoints;return i?l[1]:l[l.length-2]}}class ss{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){const e=(t,s,i,o,r,l,a,u,d)=>{const f=r*(a+d+4),T=l*(a+d+4);return function(){t.begin(),t.moveTo(o.x-f/2-T/2,o.y-T/2+f/2),t.lineTo(o.x+T/2-3*f/2,o.y-3*T/2-f/2),t.stroke()}};L.mxMarker.addMarker(yt.ARROW_DASH,e)}}function is(n){return Object.values(M).map(e=>e).includes(n)}function os(n,e){return rs(n.style,e)}function rs(n,e){const t=[],s=n.split(";"),o=s[0].replace(/shape=bpmn./g,""),r=new Map;r.set("bpmn-type-activity",C.isActivity(o)),r.set("bpmn-type-container",C.isPoolOrLane(o)),r.set("bpmn-type-event",C.isEvent(o)),r.set("bpmn-type-flow",is(o)),r.set("bpmn-type-gateway",C.isGateway(o)),r.set("bpmn-type-task",C.isTask(o));for(const[l]of[...r].filter(([,a])=>a))t.push(l);t.push(Be(o));for(const[l,a]of s.map(u=>{const d=u.split("=");return[d[0],d[1]]}))switch(l){case I.EVENT_DEFINITION_KIND:{t.push(`bpmn-event-def-${a}`);break}case I.EVENT_BASED_GATEWAY_KIND:{t.push(`bpmn-gateway-kind-${a.toLowerCase()}`);break}case I.IS_INITIATING:{t.push(a=="true"?"bpmn-icon-initiating":"bpmn-icon-non-initiating");break}case I.SUB_PROCESS_KIND:{t.push(`bpmn-sub-process-${a.toLowerCase()}`);break}case I.GLOBAL_TASK_KIND:{t.push(Be(a));break}}return e&&t.push("bpmn-label"),t}function Be(n){return n?"bpmn-"+n.replace(/([A-Z])/g,e=>"-"+e[0].toLowerCase()):""}function ls(n,e,t,s){let i,o;n.heightE.setIconOriginForIconCentered(),shapeConfig:{x:e,y:t,width:s,height:i,strokeWidth:u},iconStyleConfig:{isFilled:l,fillColor:d,strokeColor:f,strokeWidth:a,margin:T}}}class X{paintEmptyIcon(){}newBpmnCanvas({canvas:e,ratioFromParent:t,setIconOriginFunct:s,shapeConfig:i,iconStyleConfig:o},r){return new as({canvas:e,shapeConfig:i,iconConfig:{originalSize:r,styleConfig:o,ratioFromParent:t,setIconOriginFunct:s}})}paintEnvelopeIcon(e){const t={width:485.41,height:321.76},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;s.rect(0,0,i,o),s.fillAndStroke();const{iconStyleConfig:r}=e;r.isFilled&&s.setStrokeColor(r.fillColor),s.begin(),s.moveTo(0,0),s.lineTo(i*.5,o*.6),s.lineTo(i,0),s.moveTo(0,o),s.lineTo(i/3,o*.45),s.moveTo(i,o),s.lineTo(i*2/3,o*.45),s.stroke()}paintCircleIcon(e){const t={width:e.shapeConfig.width,height:e.shapeConfig.height},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;i>0&&o>0&&s.ellipse(0,0,i,o),e.iconStyleConfig.isFilled?s.fillAndStroke():s.stroke()}paintClockIcon(e){const t=this.newBpmnCanvas(e,{height:152,width:152});t.begin(),t.moveTo(184,60),t.curveTo(188.4,60,192,56.4,192,52),t.lineTo(192,48),t.curveTo(192,40,188.4,40,184,40),t.curveTo(179.6,40,176,43.6,176,48),t.lineTo(176,52),t.curveTo(176,56.4,179.6,60,184,60),t.close(),t.moveTo(184,308),t.curveTo(179.6,308,176,311.6,176,316),t.lineTo(176,320),t.curveTo(176,324.4,179.6,328,184,328),t.curveTo(188.4,328,192,324.4,192,320),t.lineTo(192,316),t.curveTo(192,311.6,188.4,308,184,308),t.close(),t.moveTo(52,176),t.lineTo(48,176),t.curveTo(43.6,176,40,179.6,40,184),t.curveTo(40,188.4,43.6,192,48,192),t.lineTo(52,192),t.curveTo(56.4,192,69,188.4,60,184),t.curveTo(60,179.6,56.4,176,52,176),t.close(),t.moveTo(320,176),t.lineTo(316,176),t.curveTo(311.6,176,308,179.6,308,184),t.curveTo(308,188.4,311.6,192,316,192),t.lineTo(320,192),t.curveTo(324.4,192,328,188.4,328,184),t.curveTo(328,179.6,324.4,176,320,176),t.moveTo(93.6,82.4),t.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),t.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),t.lineTo(85.2,96.4),t.curveTo(86.8,98,88.8,98.8,90.8,98.8),t.curveTo(92.8,98.8,94.4,98,96.4,96.4),t.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),t.lineTo(93.6,82.4),t.moveTo(85.2,271.6),t.lineTo(82.4,274.4),t.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),t.curveTo(84,287.2,86,288,88,288),t.curveTo(90,288,92,287.2,93.6,285.6),t.lineTo(96.4,282.8),t.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),t.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),t.moveTo(274.4,82.4),t.lineTo(271.6,85.2),t.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),t.curveTo(273.298,98,275.2,98.8,277.2,98.8),t.curveTo(279.2,98.8,281.2,98,282.8,96.4),t.lineTo(285.6,93.6),t.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),t.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),t.moveTo(192,180.8),t.lineTo(192,108),t.curveTo(192,103.6,188.4,100,184,100),t.curveTo(179.6,100,176,103.6,176,108),t.lineTo(176,184),t.curveTo(176,186,176.8,188,178.4,189.6),t.lineTo(266,277.2),t.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),t.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),t.curveTo(280.4,274,280.4,269.2,277.2,266),t.lineTo(192,180.8),t.moveTo(184,0),t.curveTo(82.4,0,0,82.4,0,184),t.curveTo(0,285.6,82.4,368,184,368),t.curveTo(285.6,368,368,285.6,368,184),t.curveTo(368,82.4,285.6,0,184,0),t.moveTo(184,352),t.curveTo(91.2,352,16,276.8,16,184),t.curveTo(16,91.2,91.2,16,184,16),t.curveTo(276.8,16,352,91.2,352,184),t.curveTo(352,276.8,276.8,352,184,352),t.fillAndStroke()}paintTriangleIcon(e){const t=this.newBpmnCanvas(e,{height:735,width:849});t.begin(),t.moveTo(497,55),t.lineTo(817,609),t.curveTo(849,665,808,735,744,735),t.lineTo(105,735),t.curveTo(40,735,0,665,32,609),t.lineTo(352,55),t.curveTo(384,0,465,0,497,55),t.close(),t.fillAndStroke()}paintUpArrowheadIcon(e){const t=this.newBpmnCanvas(e,{height:50,width:40});t.begin(),t.moveTo(0,49.5),t.lineTo(19.5,1),t.curveTo(19.75,.25,20,0,20.25,.25),t.lineTo(40,49.5),t.curveTo(40,49.5,39.75,50,39.6,49.75),t.lineTo(20,30),t.lineTo(.4,49.75),t.curveTo(.4,49.75,.25,50,0,49.5),t.close(),t.fillAndStroke()}paintDoubleLeftArrowheadsIcon(e){const t=this.newBpmnCanvas(e,{height:53.5,width:105});t.begin(),t.moveTo(91.4,0),t.curveTo(91.4,0,91.2,0,91,.2),t.lineTo(50,25),t.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),t.lineTo(46.4,0),t.curveTo(46.4,0,46.2,0,46,.2),t.lineTo(4.9,25),t.curveTo(2,26.2,0,27.3,4.9,28.5),t.lineTo(45.8,53),t.curveTo(46,53.3,46.2,53.5,46.4,53.5),t.lineTo(46.4,27),t.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),t.lineTo(90.8,53.3),t.curveTo(91,53.3,91.2,53.5,91.4,53.5),t.lineTo(91.4,0),t.close(),t.fillAndStroke()}drawCrossIcon(e){const t=this.newBpmnCanvas(e,{height:1,width:1});return t.begin(),t.moveTo(.38,0),t.lineTo(.62,0),t.lineTo(.62,.38),t.lineTo(1,.38),t.lineTo(1,.62),t.lineTo(.62,.62),t.lineTo(.62,1),t.lineTo(.38,1),t.lineTo(.38,.62),t.lineTo(0,.62),t.lineTo(0,.38),t.lineTo(.38,.38),t.close(),t}paintListIcon(e){const t=this.newBpmnCanvas(e,{height:60,width:60});t.begin(),t.moveTo(0,0),t.lineTo(60,0),t.lineTo(60,60),t.lineTo(0,60),t.lineTo(0,0),t.close(),t.moveTo(5,5),t.lineTo(55,5),t.close(),t.moveTo(5,21.6),t.lineTo(55,21.6),t.close(),t.moveTo(5,38.3),t.lineTo(55,38.3),t.close(),t.moveTo(5,55),t.lineTo(55,55),t.close(),t.fillAndStroke()}paintXCrossIcon(e){const t=this.drawCrossIcon(e);t.rotateOnIconCenter(45),t.fillAndStroke()}paintPlusCrossIcon(e){this.drawCrossIcon(e).fillAndStroke()}paintAsteriskIcon(e){const t=this.newBpmnCanvas(e,{height:1,width:1});Re(e,t),t.fillAndStroke(),Re(e,t),t.rotateOnIconCenter(60),t.fillAndStroke(),Re(e,t),t.rotateOnIconCenter(240),t.fillAndStroke()}paintPersonIcon(e){const t=this.newBpmnCanvas({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0}},{height:239.68,width:143.61});t.begin(),t.moveTo(124.31,150.29),t.lineTo(99.66,141.03),t.arcTo(6.43,6.43,0,0,1,95.51,135.03),t.lineTo(95.51,130.66),t.arcTo(47.75,47.75,0,0,0,119.51,89.25),t.lineTo(119.51,71.25),t.arcTo(47.62,47.62,0,0,0,101.18,33.64),t.arcTo(29.35,29.35,0,0,0,101.52,29.14),t.arcTo(29.68,29.68,0,0,0,42.17,29.14),t.arcTo(29.24,29.24,0,0,0,42.53,33.63),t.arcTo(47.65,47.65,0,0,0,24.14,71.23),t.lineTo(24.14,89.23),t.arcTo(47.7,47.7,0,0,0,48.19,130.63),t.lineTo(48.19,135.03),t.arcTo(6.43,6.43,0,0,1,44.03,141.03),t.lineTo(19.31,150.29),t.arcTo(29.81,29.81,0,0,0,.09,178.03),t.lineTo(.09,233.51),t.arcTo(5.63,5.63,0,1,0,11.34,233.51),t.lineTo(11.34,178.03),t.arcTo(18.19,18.19,0,0,1,11.57,175.17),t.lineTo(20.5,184.11),t.arcTo(12.32,12.32,0,0,1,24.14,192.89),t.lineTo(24.14,233.51),t.arcTo(5.63,5.63,0,1,0,35.39,233.51),t.lineTo(35.39,192.93),t.arcTo(23.5,23.5,0,0,0,28.46,176.2),t.lineTo(17.04,164.78),t.arcTo(18.34,18.34,0,0,1,23.29,160.78),t.lineTo(43.65,153.15),t.lineTo(66.22,175.72),t.lineTo(66.22,233.51),t.arcTo(5.63,5.63,0,1,0,77.47,233.51),t.lineTo(77.47,175.76),t.lineTo(100.04,153.19),t.lineTo(120.4,160.82),t.arcTo(18.39,18.39,0,0,1,126.65,164.82),t.lineTo(115.24,176.24),t.arcTo(23.5,23.5,0,0,0,108.31,192.93),t.lineTo(108.31,233.55),t.arcTo(5.63,5.63,0,1,0,119.56,233.55),t.lineTo(119.56,192.93),t.arcTo(12.35,12.35,0,0,1,123.19,184.15),t.lineTo(132.13,175.22),t.arcTo(18,18,0,0,1,132.36,178.08),t.lineTo(132.36,233.56),t.arcTo(5.63,5.63,0,0,0,143.61,233.56),t.lineTo(143.61,178.03),t.arcTo(29.81,29.81,0,0,0,124.31,150.29),t.close(),t.moveTo(71.85,10.72),t.arcTo(18.46,18.46,0,0,1,90.17,27.18),t.arcTo(47.68,47.68,0,0,0,53.53,27.18),t.arcTo(18.44,18.44,0,0,1,71.85,10.72),t.close(),t.moveTo(35.39,71.23),t.arcTo(36.46,36.46,0,0,1,108.31,71.23),t.lineTo(108.31,77.4),t.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),t.arcTo(5.62,5.62,0,0,0,48.78,62.71),t.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),t.close(),t.moveTo(35.39,89.23),t.lineTo(35.39,87.08),t.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),t.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),t.lineTo(108.31,89.24),t.arcTo(36.46,36.46,0,1,1,35.39,89.24),t.close(),t.moveTo(71.85,165.45),t.lineTo(54.06,147.69),t.arcTo(17.7,17.7,0,0,0,59.43,135.32),t.arcTo(47.57,47.57,0,0,0,84.27,135.32),t.arcTo(17.7,17.7,0,0,0,89.64,147.69),t.close(),t.fill()}paintGearIcon(e){const t=this.newBpmnCanvas(e,{height:100,width:100});X.paintGearIconBackground(t),t.translateIconOrigin(14,14),X.paintGearIconForeground(t)}static paintGearIconBackground(e){e.begin(),e.moveTo(2.06,24.62),e.lineTo(10.17,30.95),e.lineTo(9.29,37.73),e.lineTo(0,41.42),e.lineTo(2.95,54.24),e.lineTo(13.41,52.92),e.lineTo(17.39,58.52),e.lineTo(13.56,67.66),e.lineTo(24.47,74.44),e.lineTo(30.81,66.33),e.lineTo(37.88,67.21),e.lineTo(41.57,76.5),e.lineTo(54.24,73.55),e.lineTo(53.06,62.94),e.lineTo(58.52,58.52),e.lineTo(67.21,63.09),e.lineTo(74.58,51.88),e.lineTo(66.03,45.25),e.lineTo(66.92,38.62),e.lineTo(76.5,34.93),e.lineTo(73.7,22.26),e.lineTo(62.64,23.44),e.lineTo(58.81,18.42),e.lineTo(62.79,8.7),e.lineTo(51.74,2.21),e.lineTo(44.81,10.47),e.lineTo(38.03,9.43),e.lineTo(33.75,0),e.lineTo(21.52,3.24),e.lineTo(22.7,13.56),e.lineTo(18.13,17.54),e.lineTo(8.7,13.56),e.close();const t=24.8,s=39;X.paintGearInnerCircle(e,t,s)}static paintGearIconForeground(e){e.begin(),e.moveTo(16.46,41.42),e.lineTo(24.57,47.75),e.lineTo(23.69,54.53),e.lineTo(14.4,58.22),e.lineTo(17.35,71.04),e.lineTo(27.81,69.72),e.lineTo(31.79,75.32),e.lineTo(27.96,84.46),e.lineTo(38.87,91.24),e.lineTo(45.21,83.13),e.lineTo(52.28,84.01),e.lineTo(55.97,93.3),e.lineTo(68.64,90.35),e.lineTo(67.46,79.74),e.lineTo(72.92,75.32),e.lineTo(81.61,79.89),e.lineTo(88.98,68.68),e.lineTo(80.43,62.05),e.lineTo(81.32,55.42),e.lineTo(90.9,51.73),e.lineTo(88.1,39.06),e.lineTo(77.04,40.24),e.lineTo(73.21,35.22),e.lineTo(77.19,25.5),e.lineTo(66.14,19.01),e.lineTo(59.21,27.27),e.lineTo(52.43,26.23),e.lineTo(48.15,16.8),e.lineTo(35.92,20.04),e.lineTo(37.1,30.36),e.lineTo(32.53,34.34),e.lineTo(23.1,30.36),e.close();const t=39.2,s=55.8;X.paintGearInnerCircle(e,t,s),e.begin(),X.paintGearInnerCircle(e,t,s)}static paintGearInnerCircle(e,t,s){e.moveTo(t,s),e.arcTo(13.5,13.5,0,1,1,t+2*13.5,s),e.arcTo(13.5,13.5,0,0,1,t,s),e.close(),e.fillAndStroke()}paintExpandIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;s.roundrect(0,0,i,o,2,2),s.stroke(),s.begin(),s.moveTo(i/2,o/4),s.lineTo(i/2,o*3/4),s.close(),s.moveTo(i/4,o/2),s.lineTo(i*3/4,o/2),s.close(),s.fillAndStroke()}paintLoopIcon(e){const{iconStyleConfig:t}=e;t.fillColor=t.strokeColor;const s=this.newBpmnCanvas(e,{width:22.49,height:21.62});s.begin(),s.moveTo(5.5,19.08),s.arcTo(8,8,0,1,1,10.5,21.08),s.stroke(),s.begin(),s.moveTo(7.5,14.08),s.lineTo(5.75,19.08),s.lineTo(0,17.08),s.close(),s.fillAndStroke()}paintSequentialMultiInstanceIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),{canvas:i,iconStyleConfig:o}=e;i.setFillColor(o.strokeColor);const r=t.width,l=t.height/5;s.rect(0,0,r,l),s.fill(),s.rect(0,2*l,r,l),s.fill(),s.rect(0,4*l,r,l),s.fill()}paintParallelMultiInstanceIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),{canvas:i,iconStyleConfig:o}=e;i.setFillColor(o.strokeColor);const r=t.width/5,l=t.height;s.begin(),s.rect(0,0,r,l),s.fill(),s.rect(2*r,0,r,l),s.fill(),s.rect(4*r,0,r,l),s.fill()}paintRightArrowIcon(e){const t=this.newBpmnCanvas(e,{width:512,height:415.23});t.setRoundLineJoin(),t.begin(),t.moveTo(512,207.61),t.lineTo(304.38,0),t.lineTo(304.38,135.39),t.lineTo(0,135.39),t.lineTo(0,279.84),t.lineTo(304.38,279.84),t.lineTo(304.38,415.23),t.lineTo(512,207.61),t.close(),t.fillAndStroke()}paintErrorIcon(e){const t=this.newBpmnCanvas(e,{width:72.44,height:71.82});t.begin(),t.moveTo(0,53.32),t.lineTo(19.48,0),t.lineTo(19.48,0),t.lineTo(50.85,40.07),t.lineTo(72.44,18.21),t.lineTo(53.12,71.82),t.lineTo(22.5,31.37),t.close(),t.fillAndStroke()}paintHandIcon(e){const t=this.newBpmnCanvas(e,{width:343.65,height:354.12});t.begin(),t.moveTo(231.66,336.39),t.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),t.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),t.lineTo(146.33,248.39),t.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),t.curveTo(275.75,283.38,297.25,288,301.42,267.77),t.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),t.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),t.lineTo(165.2,194.8),t.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),t.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),t.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),t.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),t.lineTo(169.35,138.97),t.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),t.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),t.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),t.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),t.lineTo(127.61,81.87),t.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),t.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),t.curveTo(143.83,0,124.08,14.49,124.08,14.49),t.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),t.lineTo(0,251.94),t.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),t.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),t.fillAndStroke()}paintScriptIcon(e){e.iconStyleConfig.fillColor=e.iconStyleConfig.strokeColor;const t=this.newBpmnCanvas(e,{width:458.75,height:461.64});t.begin(),t.moveTo(67.85,.57),t.curveTo(50.73,0,33.26,8.86,22.35,18.84),t.curveTo(8.11,32.15,0,50.77,0,70.26),t.curveTo(0,73.15,0,87.59,0,113.6),t.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),t.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),t.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),t.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),t.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),t.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),t.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),t.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),t.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),t.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),t.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),t.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),t.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),t.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),t.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),t.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),t.curveTo(389.09,14.11,366.95,.59,341.75,.59),t.curveTo(286.97,.59,122.63,.57,67.85,.57),t.close(),t.moveTo(85.04,72.68),t.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),t.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),t.curveTo(55.8,44.28,59.84,41,73.82,41),t.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),t.close(),t.moveTo(364.94,52.9),t.curveTo(370,61.11,373.9,76.44,377.38,93.51),t.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),t.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),t.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),t.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),t.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),t.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),t.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),t.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),t.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),t.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),t.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),t.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),t.close(),t.moveTo(409.96,399.48),t.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),t.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),t.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),t.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),t.close(),t.fill(),t.begin(),t.moveTo(182.1,131.2),t.lineTo(182.1,151.68),t.lineTo(321.89,151.68),t.lineTo(321.89,131.2),t.lineTo(182.1,131.2),t.close(),t.moveTo(162.25,251.09),t.lineTo(162.25,271.49),t.lineTo(301.96,271.49),t.lineTo(301.96,251.09),t.lineTo(162.25,251.09),t.close(),t.fill()}paintTableIcon(e){const t=this.newBpmnCanvas(e,{width:640,height:640});t.begin(),t.moveTo(.19,.1),t.lineTo(298.78,.1),t.lineTo(298.78,198.88),t.lineTo(.19,198.88),t.lineTo(.19,.1),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(0,0),t.lineTo(298.78,0),t.lineTo(298.78,48.88),t.lineTo(0,48.88),t.lineTo(0,0),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(0,48.88),t.lineTo(98.78,48.88),t.lineTo(98.78,198.88),t.lineTo(0,198.88),t.lineTo(0,48.88),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(1.09,122.69),t.lineTo(298.78,122.69),t.close(),t.fillAndStroke(),t.setFillColor(e.iconStyleConfig.strokeColor),t.begin(),t.moveTo(0,0),t.lineTo(298.78,0),t.lineTo(298.78,48.88),t.lineTo(0,48.88),t.lineTo(0,0),t.close(),t.fillAndStroke()}paintPentagon(e){const t=this.newBpmnCanvas(e,{width:16,height:16});t.begin(),t.moveTo(16,6.5),t.lineTo(8,0),t.lineTo(0,6.5),t.lineTo(3,16),t.lineTo(13,16),t.lineTo(16,6.5),t.lineTo(8,0),t.stroke()}}function Re(n,e){e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,1),e.lineTo(.38,1),e.close()}class se{static get(){return this.instance}static set(e){this.instance=e}}g(se,"instance",new X);const cs=[w.LOOP,w.MULTI_INSTANCE_PARALLEL,w.MULTI_INSTANCE_SEQUENTIAL,w.COMPENSATION,w.EXPAND,w.ADHOC];function us(n){const e=cs.filter(t=>n.includes(t));for(const t of n.filter(s=>!e.includes(s)))e.push(t);return e}function Pt(n,e){se.get().paintEnvelopeIcon({...n,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:{...n.iconStyleConfig,isFilled:e}})}class He extends We{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter",se.get())}paintForeground(t,s,i,o,r){super.paintForeground(t,s,i,o,r),this.paintMarkerIcons(ne({canvas:t,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(t){const s=O.getValue(this.style,I.MARKERS,void 0);if(s){const i=us(s.split(","));for(const[o,r]of i.entries()){switch(t={...t,setIconOriginFunct:this.getMarkerIconOriginFunction(i.length,o+1)},t.canvas.save(),r){case w.LOOP:{this.iconPainter.paintLoopIcon(t);break}case w.MULTI_INSTANCE_SEQUENTIAL:{this.iconPainter.paintSequentialMultiInstanceIcon(t);break}case w.MULTI_INSTANCE_PARALLEL:{this.iconPainter.paintParallelMultiInstanceIcon(t);break}case w.EXPAND:{this.iconPainter.paintExpandIcon(t);break}}t.canvas.restore()}}}getMarkerIconOriginFunction(t,s){return t===1?i=>i.setIconOriginForIconBottomCentered():i=>{i.setIconOriginForIconBottomCentered();const o=Math.pow(-1,s)*(p.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+p.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);i.translateIconOrigin(o,0)}}}class K extends He{paintForeground(e,t,s,i,o){super.paintForeground(e,t,s,i,o),this.paintTaskIcon(ne({canvas:e,x:t,y:s,width:i,height:o,shape:this}))}}class ds extends K{paintTaskIcon(e){this.iconPainter.paintEmptyIcon()}}class hs extends K{paintTaskIcon(e){this.iconPainter.paintGearIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class fs extends K{paintTaskIcon(e){this.iconPainter.paintPersonIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class gs extends K{paintTaskIcon(e){if(!_t(this.style)){Pt(e,!1);return}const t=4,s=4,i={...e.shapeConfig,width:20,height:20};this.iconPainter.paintCircleIcon({canvas:e.canvas,shapeConfig:i,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1},ratioFromParent:void 0,setIconOriginFunct:o=>o.setIconOriginToShapeTopLeft(s,t)}),i.x+=t,i.y+=s,this.iconPainter.paintEnvelopeIcon({...e,shapeConfig:i,ratioFromParent:.65,setIconOriginFunct:o=>o.setIconOriginForIconCentered()})}}class Ts extends K{paintTaskIcon(e){Pt(e,!0)}}class ps extends K{paintTaskIcon(e){this.iconPainter.paintHandIcon({...e,ratioFromParent:.18,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class Es extends K{paintTaskIcon(e){this.iconPainter.paintScriptIcon({...e,ratioFromParent:.22,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class Ss extends He{paintForeground(e,t,s,i,o){super.paintForeground(e,t,s,i,o);const r=ne({canvas:e,x:t,y:s,width:i,height:o,shape:this});switch(O.getValue(this.style,I.GLOBAL_TASK_KIND,void 0)){case h.GLOBAL_TASK_MANUAL:{this.iconPainter.paintHandIcon({...r,ratioFromParent:.18,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case h.GLOBAL_TASK_SCRIPT:{this.iconPainter.paintScriptIcon({...r,ratioFromParent:.22,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case h.GLOBAL_TASK_USER:{this.iconPainter.paintPersonIcon({...r,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case h.GLOBAL_TASK_BUSINESS_RULE:{this.iconPainter.paintTableIcon({...r,ratioFromParent:.6,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(15)});break}default:this.iconPainter.paintEmptyIcon()}}}class ms extends He{paintBackground(e,t,s,i,o){const r=O.getValue(this.style,I.SUB_PROCESS_KIND,void 0);if(e.save(),r===W.EVENT&&(e.setDashed(!0,!1),e.setDashPattern("1 2")),super.paintBackground(e,t,s,i,o),r===W.TRANSACTION){const l=p.SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET,a=p.SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE;e.roundrect(t+l,s+l,i-2*l,o-2*l,a,a),e.stroke()}e.restore()}}class Is extends K{paintTaskIcon(e){this.iconPainter.paintTableIcon({...e,ratioFromParent:.6,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(15)})}}class Cs extends L.mxConnector{paintEdgeShape(e,t){const s=this.createMarker(e,t,!0),i=this.createMarker(e,t,!1);this.paintEdgeLine(e,t),e.setShadow(!1),e.setDashed(!1,!1),s!=null&&(e.setFillColor(O.getValue(this.style,I.EDGE_START_FILL_COLOR,this.stroke)),s()),i!=null&&(e.setFillColor(O.getValue(this.style,I.EDGE_END_FILL_COLOR,this.stroke)),i())}paintEdgeLine(e,t){const s=As(e);ct(e,"stroke"),this.paintLine(e,t,this.isRounded),ct(e,s)}}function As(n){return n instanceof he?n.pointerEventsValue:null}function ct(n,e){n instanceof he&&(n.pointerEventsValue=e)}class ee extends L.mxEllipse{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter",se.get());g(this,"iconPainters",new Map([[b.MESSAGE,t=>this.iconPainter.paintEnvelopeIcon({...t,ratioFromParent:.5})],[b.TERMINATE,t=>this.iconPainter.paintCircleIcon({...t,ratioFromParent:.6})],[b.TIMER,t=>this.iconPainter.paintClockIcon({...t,setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(5)})],[b.SIGNAL,t=>this.iconPainter.paintTriangleIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:p.STROKE_WIDTH_THIN.valueOf()},setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(4)})],[b.LINK,t=>this.iconPainter.paintRightArrowIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[b.ERROR,t=>this.iconPainter.paintErrorIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[b.COMPENSATION,t=>this.iconPainter.paintDoubleLeftArrowheadsIcon({...t,ratioFromParent:.7,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[b.CANCEL,t=>this.iconPainter.paintXCrossIcon({...t,ratioFromParent:.78})],[b.ESCALATION,t=>this.iconPainter.paintUpArrowheadIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:p.STROKE_WIDTH_THIN.valueOf()}})],[b.CONDITIONAL,t=>this.iconPainter.paintListIcon({...t,ratioFromParent:.6,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})]]));g(this,"withFilledIcon",!1)}paintVertexShape(t,s,i,o,r){const l=ne({canvas:t,x:s,y:i,width:o,height:r,shape:this,isFilled:this.withFilledIcon});ee.setDashedOuterShapePattern(l,O.getValue(this.style,I.IS_INTERRUPTING,void 0)),this.paintOuterShape(l),ee.restoreOriginalOuterShapePattern(l),this.paintInnerShape(l)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(t,s,i,o,r)}paintInnerShape(t){(this.iconPainters.get(O.getValue(this.style,I.EVENT_DEFINITION_KIND,b.NONE))??(()=>this.iconPainter.paintEmptyIcon()))(t)}static setDashedOuterShapePattern(t,s){t.canvas.save(),s==="false"&&(t.canvas.setDashed(!0,!1),t.canvas.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(t){t.canvas.restore()}}class Os extends ee{constructor(){super(),this.withFilledIcon=!0}}class Ge extends ee{paintOuterShape({canvas:e,shapeConfig:{x:t,y:s,width:i,height:o,strokeWidth:r}}){e.ellipse(t,s,i,o),e.fillAndStroke();const l=r*1.5;e.ellipse(i*.02+l+t,o*.02+l+s,i*.96-2*l,o*.96-2*l),e.stroke()}}class Ns extends Ge{constructor(){super(),this.withFilledIcon=!0}}class vs extends We{constructor(){super(...arguments);g(this,"iconPainter",se.get())}paintVertexShape(t,s,i,o,r){const l=ne({canvas:t,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:1,isFilled:O.getValue(this.style,I.IS_INITIATING,"true")=="false"});this.iconPainter.paintEnvelopeIcon(l)}}class Te extends L.mxRhombus{constructor(){super(...arguments);g(this,"iconPainter",se.get())}paintVertexShape(t,s,i,o,r){const l=ne({canvas:t,x:s,y:i,width:o,height:r,shape:this});this.paintOuterShape(l),this.paintInnerShape(l)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(t,s,i,o,r)}}class Ls extends Te{paintInnerShape(e){this.iconPainter.paintXCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class ys extends Te{paintInnerShape(e){this.iconPainter.paintPlusCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class _s extends Te{paintInnerShape(e){this.iconPainter.paintCircleIcon({...e,ratioFromParent:.62,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1,strokeWidth:p.STROKE_WIDTH_THICK.valueOf()}})}}class ws extends Te{paintInnerShape(e){this.iconPainter.paintAsteriskIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class bs extends Te{paintInnerShape(e){e={...e,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1}},this.iconPainter.paintCircleIcon({...e,ratioFromParent:.55}),_t(this.style)||this.iconPainter.paintCircleIcon({...e,ratioFromParent:.45});const t={...e,ratioFromParent:.3};O.getValue(this.style,I.EVENT_BASED_GATEWAY_KIND,de.Exclusive)==de.Parallel?this.iconPainter.paintPlusCrossIcon(t):this.iconPainter.paintPentagon(t)}}class Rs extends We{paintForeground(e,t,s,i,o){e.begin(),e.moveTo(t+p.TEXT_ANNOTATION_BORDER_LENGTH,s),e.lineTo(t,s),e.lineTo(t,s+o),e.lineTo(t+p.TEXT_ANNOTATION_BORDER_LENGTH,s+o),e.stroke()}paintBackground(e,t,s,i,o){e.save(),e.setStrokeColor("none"),super.paintBackground(e,t,s,i,o),e.restore()}}class Fs{configureShapes(){this.initMxSvgCanvasPrototype(),this.initMxShapePrototype(),this.registerShapes()}registerShapes(){v.registerShape(h.EVENT_END,Os),v.registerShape(h.EVENT_START,ee),v.registerShape(h.EVENT_INTERMEDIATE_THROW,Ns),v.registerShape(h.EVENT_INTERMEDIATE_CATCH,Ge),v.registerShape(h.EVENT_BOUNDARY,Ge),v.registerShape(h.GATEWAY_COMPLEX,ws),v.registerShape(h.GATEWAY_EVENT_BASED,bs),v.registerShape(h.GATEWAY_EXCLUSIVE,Ls),v.registerShape(h.GATEWAY_INCLUSIVE,_s),v.registerShape(h.GATEWAY_PARALLEL,ys),v.registerShape(h.SUB_PROCESS,ms),v.registerShape(h.CALL_ACTIVITY,Ss),v.registerShape(h.TASK,ds),v.registerShape(h.TASK_SERVICE,hs),v.registerShape(h.TASK_USER,fs),v.registerShape(h.TASK_RECEIVE,gs),v.registerShape(h.TASK_SEND,Ts),v.registerShape(h.TASK_MANUAL,ps),v.registerShape(h.TASK_SCRIPT,Es),v.registerShape(h.TASK_BUSINESS_RULE,Is),v.registerShape(h.TEXT_ANNOTATION,Rs),v.registerShape(I.EDGE,Cs),v.registerShape(I.MESSAGE_FLOW_ICON,vs)}initMxSvgCanvasPrototype(){he.prototype.getTextCss=function(){const e=this.state,t=c.ABSOLUTE_LINE_HEIGHT?e.fontSize*c.LINE_HEIGHT+"px":c.LINE_HEIGHT*this.lineHeightCorrection;let s="display: inline-block; font-size: "+e.fontSize+"px; font-family: "+e.fontFamily+"; color: "+e.fontColor+"; line-height: "+t+"; pointer-events: none; ";(e.fontStyle&c.FONT_BOLD)==c.FONT_BOLD&&(s+="font-weight: bold; "),(e.fontStyle&c.FONT_ITALIC)==c.FONT_ITALIC&&(s+="font-style: italic; ");const i=[];return(e.fontStyle&c.FONT_UNDERLINE)==c.FONT_UNDERLINE&&i.push("underline"),(e.fontStyle&c.FONT_STRIKETHROUGH)==c.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(s+="text-decoration: "+i.join(" ")+"; "),s}}initMxShapePrototype(){L.mxShape.prototype.createSvgCanvas=function(){var s;const e=new he(this.node,!1);e.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,e.pointerEventsValue=this.svgPointerEvents;const t=this.getSvgScreenOffset();if(t==0?this.node.removeAttribute("transform"):this.node.setAttribute("transform","translate("+t+","+t+")"),(s=this.state)!=null&&s.cell){const i=this.state.cell,o=os(i,this.dialect===c.DIALECT_STRICTHTML),r=this.state.style[I.EXTRA_CSS_CLASSES];typeof r=="string"&&o.push(...r.split(",")),this.node.setAttribute("class",o.join(" ")),this.node.setAttribute("data-bpmn-id",this.state.cell.id)}return e.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(e.format=function(i){return Math.round(parseFloat(i))}),e}}}const ut=12;class kt{constructor(e){g(this,"specificFlowStyles",new Fe([[M.SEQUENCE_FLOW,e=>{e[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN}],[M.MESSAGE_FLOW,e=>{e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="8 5",e[c.STYLE_STARTARROW]=c.ARROW_OVAL,e[c.STYLE_STARTSIZE]=8,e[c.STYLE_STARTFILL]=!0,e[I.EDGE_START_FILL_COLOR]=p.MESSAGE_FLOW_MARKER_START_FILL_COLOR,e[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN,e[c.STYLE_ENDFILL]=!0,e[I.EDGE_END_FILL_COLOR]=p.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[M.ASSOCIATION_FLOW,e=>{e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="1 2",e[c.STYLE_STARTSIZE]=ut}]]));g(this,"specificSequenceFlowStyles",new Fe([[V.DEFAULT,e=>{e[c.STYLE_STARTARROW]=yt.ARROW_DASH}],[V.CONDITIONAL_FROM_ACTIVITY,e=>{e[c.STYLE_STARTARROW]=c.ARROW_DIAMOND_THIN,e[c.STYLE_STARTSIZE]=18,e[c.STYLE_STARTFILL]=!0,e[I.EDGE_START_FILL_COLOR]=p.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]));g(this,"specificAssociationFlowStyles",new Fe([[j.NONE,e=>{}],[j.ONE,e=>{e[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}],[j.BOTH,e=>{e[c.STYLE_STARTARROW]=c.ARROW_OPEN_THIN,e[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}]]));this.graph=e}configureStyles(){this.configureDefaultVertexStyle(),this.configurePoolStyle(),this.configureLaneStyle(),this.configureTextAnnotationStyle(),this.configureGroupStyle(),this.configureActivityStyles(),this.configureEventStyles(),this.configureGatewayStyles(),this.configureDefaultEdgeStyle(),this.configureFlowStyles()}getStylesheet(){return this.graph.getStylesheet()}putCellStyle(e,t){this.getStylesheet().putCellStyle(e,t)}configureDefaultVertexStyle(){const e=this.getStylesheet().getDefaultVertexStyle();dt(e),e[c.STYLE_ABSOLUTE_ARCSIZE]=!0,e[c.STYLE_ARCSIZE]=p.SHAPE_ARC_SIZE}configurePoolStyle(){const e={};e[c.STYLE_SHAPE]=c.SHAPE_SWIMLANE,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_STARTSIZE]=p.POOL_LABEL_SIZE,e[c.STYLE_FILLCOLOR]=p.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.POOL,e)}configureLaneStyle(){const e={};e[c.STYLE_SHAPE]=c.SHAPE_SWIMLANE,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_SWIMLANE_LINE]=0,e[c.STYLE_STARTSIZE]=p.LANE_LABEL_SIZE,e[c.STYLE_FILLCOLOR]=p.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.LANE,e)}configureEventStyles(){for(const e of C.eventKinds()){const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_PERIMETER]=st.EllipsePerimeter,t[c.STYLE_STROKEWIDTH]=e==h.EVENT_END?p.STROKE_WIDTH_THICK:p.STROKE_WIDTH_THIN,t[c.STYLE_VERTICAL_LABEL_POSITION]=c.ALIGN_BOTTOM,this.putCellStyle(e,t)}}configureTextAnnotationStyle(){const e={};e[c.STYLE_SHAPE]=h.TEXT_ANNOTATION,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_ALIGN]=c.ALIGN_LEFT,e[c.STYLE_SPACING_LEFT]=5,e[c.STYLE_FILLCOLOR]=p.TEXT_ANNOTATION_FILL_COLOR,e[c.STYLE_STROKEWIDTH]=p.STROKE_WIDTH_THIN,this.putCellStyle(h.TEXT_ANNOTATION,e)}configureGroupStyle(){const e={};e[c.STYLE_ROUNDED]=!0,e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="7 4 1 4",e[c.STYLE_STROKEWIDTH]=p.STROKE_WIDTH_THIN,e[c.STYLE_FILLCOLOR]=p.GROUP_FILL_COLOR,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_TOP,this.putCellStyle(h.GROUP,e)}configureActivityStyles(){for(const e of C.activityKinds()){const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_ROUNDED]=!0,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,t[c.STYLE_STROKEWIDTH]=e==h.CALL_ACTIVITY?p.STROKE_WIDTH_THICK:p.STROKE_WIDTH_THIN,this.putCellStyle(e,t)}}configureGatewayStyles(){for(const e of C.gatewayKinds()){const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_PERIMETER]=st.RhombusPerimeter,t[c.STYLE_STROKEWIDTH]=p.STROKE_WIDTH_THIN,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_TOP,t[c.STYLE_LABEL_POSITION]=c.ALIGN_LEFT,t[c.STYLE_VERTICAL_LABEL_POSITION]=c.ALIGN_TOP,this.putCellStyle(e,t)}}configureDefaultEdgeStyle(){const e=this.getStylesheet().getDefaultEdgeStyle();dt(e),e[c.STYLE_SHAPE]=I.EDGE,e[c.STYLE_ENDSIZE]=ut,e[c.STYLE_STROKEWIDTH]=1.5,e[c.STYLE_ROUNDED]=!0,e[c.STYLE_ARCSIZE]=5,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_BOTTOM,delete e[c.STYLE_ENDARROW]}configureEdgeStyles(e,t){for(const s of e){const i={};t.get(s)(i),this.graph.getStylesheet().putCellStyle(s.toString(),i)}}configureFlowStyles(){this.configureEdgeStyles(Object.values(M),this.specificFlowStyles),this.configureEdgeStyles(Object.values(V),this.specificSequenceFlowStyles),this.configureEdgeStyles(Object.values(j),this.specificAssociationFlowStyles)}}function dt(n){n[c.STYLE_FONTFAMILY]=p.DEFAULT_FONT_FAMILY,n[c.STYLE_FONTSIZE]=p.DEFAULT_FONT_SIZE,n[c.STYLE_FONTCOLOR]=p.DEFAULT_FONT_COLOR,n[c.STYLE_FILLCOLOR]=p.DEFAULT_FILL_COLOR,n[c.STYLE_STROKECOLOR]=p.DEFAULT_STROKE_COLOR,n[c.STYLE_LABEL_BACKGROUNDCOLOR]=c.NONE,n[c.STYLE_WHITE_SPACE]="wrap"}class Fe extends Map{get(e){return super.get(e)??(()=>{})}}class Ps{constructor(e){g(this,"graph");this.container=e,this.graph=new ts(e)}configure(e){return this.configureGraph(),this.configureNavigationSupport(e),new kt(this.graph).configureStyles(),new Fs().configureShapes(),new ss().configureMarkers(),this.graph}configureGraph(){this.graph.setCellsLocked(!0),this.graph.setCellsSelectable(!1),this.graph.setEdgeLabelsMovable(!1),this.graph.setHtmlLabels(!0),this.graph.setConstrainChildren(!1),this.graph.setExtendParents(!1),this.graph.foldingEnabled=!1}configureNavigationSupport(e){var s;const t=this.graph.panningHandler;(s=e==null?void 0:e.navigation)!=null&&s.enabled?(t.addListener(D.PAN_START,this.getPanningHandler("grab")),t.addListener(D.PAN_END,this.getPanningHandler("default")),t.usePopupTrigger=!1,t.isForcePanningEvent=i=>D.isLeftMouseButton(i.getEvent())||D.isMultiTouchEvent(i.getEvent()),this.graph.setPanning(!0),this.graph.registerMouseWheelZoomListeners(e.navigation.zoom)):(this.graph.setPanning(!1),t.setPinchEnabled(!1),t.isForcePanningEvent=i=>!1)}getPanningHandler(e){return()=>{this.graph.isEnabled()&&(this.container.style.cursor=e)}}}class ks{constructor(e){this.graph=e}fit(e){this.graph.customFit(e)}zoom(e){e=="in"?this.graph.zoomIn():this.graph.zoomOut()}}class xs{constructor(e){this.convertedElements=e}deserialize(e){const t=m(e.category).flatMap(s=>m(s.categoryValue));for(const s of t)this.convertedElements.registerCategoryValue(s.id,s.value)}}class ie{}class Ms{warning(e){const t=e.getMessage();console.warn(`[bv-parser] ${t.template}`,...t.arguments)}}class Bs extends ie{constructor(e,t){super(),this.groupBpmnElementId=e,this.categoryValueReference=t}getMessage(){return{arguments:[this.categoryValueReference,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class Gs extends ie{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class Vs extends ie{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class Ys extends ie{constructor(e,t){super(),this.shapeOrEdgeId=e,this.labelStyleId=t}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class Us extends ie{constructor(e,t){super(),this.laneId=e,this.flowNodeReference=t}getMessage(){return{arguments:[this.flowNodeReference,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class Ws extends ie{constructor(e,t,s){super(),this.bpmnElementId=e,this.attachedToReference=t,this.attachedToKind=s}getMessage(){return{arguments:[this.bpmnElementId,this.attachedToReference,this.attachedToKind],template:"The boundary event %s must be attached to an activity, and not to %s of kind %s"}}}class Ds{constructor(){g(this,"poolsById",new Map);g(this,"poolsByProcessRef",new Map);g(this,"messageFlows",new Map);g(this,"flowNodes",new Map);g(this,"lanes",new Map);g(this,"sequenceFlows",new Map);g(this,"associationFlows",new Map);g(this,"eventDefinitionsOfDefinitions",new Map);g(this,"globalTasks",new Map);g(this,"categoryValues",new Map)}getFlows(){return[...this.messageFlows.values(),...this.sequenceFlows.values(),...this.associationFlows.values()]}findPoolById(e){return this.poolsById.get(e)}findPoolByProcessRef(e){return this.poolsByProcessRef.get(e)}registerPool(e,t){this.poolsById.set(e.id,e),t&&this.poolsByProcessRef.set(t,e)}findMessageFlow(e){return this.messageFlows.get(e)}registerMessageFlow(e){this.messageFlows.set(e.id,e)}findFlowNode(e){return this.flowNodes.get(e)}registerFlowNode(e){this.flowNodes.set(e.id,e)}findLane(e){return this.lanes.get(e)}registerLane(e){this.lanes.set(e.id,e)}findSequenceFlow(e){return this.sequenceFlows.get(e)}registerSequenceFlow(e){this.sequenceFlows.set(e.id,e)}findAssociationFlow(e){return this.associationFlows.get(e)}registerAssociationFlow(e){this.associationFlows.set(e.id,e)}findEventDefinitionOfDefinition(e){return this.eventDefinitionsOfDefinitions.get(e)}registerEventDefinitionsOfDefinition(e,t){this.eventDefinitionsOfDefinitions.set(e,t)}findGlobalTask(e){return this.globalTasks.get(e)}registerGlobalTask(e,t){this.globalTasks.set(e,t)}findCategoryValue(e){return this.categoryValues.get(e)}registerCategoryValue(e,t){this.categoryValues.set(e,{value:t})}}const xt=(n,e,t,s)=>{const i=n.findCategoryValue(t.categoryValueRef);if(i)return new Y(t.id,i.value,h.GROUP,s);e.warning(new Bs(t.id,t.categoryValueRef))};class Hs{constructor(e,t){this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){for(const t of m(e))this.parseCollaboration(t)}parseCollaboration(e){this.buildParticipant(e.participant),this.buildMessageFlows(e.messageFlow),this.buildGroups(e.group)}buildParticipant(e){for(const t of m(e))this.convertedElements.registerPool(new Y(t.id,t.name,h.POOL),t.processRef)}buildMessageFlows(e){for(const t of m(e))this.convertedElements.registerMessageFlow(new Ct(t.id,t.name,t.sourceRef,t.targetRef))}buildGroups(e){for(const t of m(e)){const s=xt(this.convertedElements,this.parsingMessageCollector,t);s&&this.convertedElements.registerFlowNode(s)}}}class Ks{constructor(e,t,s,i){this.x=e,this.y=t,this.width=s,this.height=i}}class zs{constructor(e,t,s,i,o=ge.NONE){g(this,"extensions",{});this.id=e,this.bpmnElement=t,this.waypoints=s,this.label=i,this.messageVisibleKind=o}}class Xs{constructor(e,t){this.x=e,this.y=t}}class $s{constructor(e,t){g(this,"extensions",{});this.font=e,this.bounds=t}}class Zs{constructor(e,t,s,i,o,r){this.name=e,this.size=t,this.isBold=s,this.isItalic=i,this.isUnderline=o,this.isStrikeThrough=r}}class Q{constructor(e,t){g(this,"convertedFonts",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){const t=[],s=[],i=[],o=[],r=m(e)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const l=r.BPMNPlane,a=this.deserializeEdges(l.BPMNEdge),u=this.deserializeShapes(l.BPMNShape);t.push(...u.flowNodes),s.push(...u.lanes),i.push(...u.pools),o.push(...a)}return{flowNodes:t,lanes:s,pools:i,edges:o}}deserializeFonts(e){this.convertedFonts=new Map;for(const t of m(e))for(const s of m(t.Font))this.convertedFonts.set(t.id,new Zs(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))}deserializeShapes(e){const t={flowNodes:[],lanes:[],pools:[]};for(const s of m(e))this.deserializeShapeAndStoreIfFound(s,t.flowNodes,i=>this.convertedElements.findFlowNode(i))||this.deserializeShapeAndStoreIfFound(s,t.lanes,i=>this.convertedElements.findLane(i))||this.deserializeShapeAndStoreIfFound(s,t.pools,i=>this.convertedElements.findPoolById(i))||this.parsingMessageCollector.warning(new Gs(s.bpmnElement));return t}deserializeShapeAndStoreIfFound(e,t,s){const i=this.deserializeShape(e,s);return i?(t.push(i),!0):!1}deserializeShape(e,t){const s=t(e.bpmnElement);if(s){const i=Q.deserializeBounds(e);(s instanceof fe||s instanceof Z&&s.callActivityKind===ue.CALLING_PROCESS)&&!e.isExpanded&&s.markers.push(w.EXPAND);let o;C.isPoolOrLane(s.kind)&&(o=e.isHorizontal??!0);const r=e.BPMNLabel,l=this.deserializeLabel(r,e.id),a=new me(e.id,s,i,l,o);return Q.setColorExtensionsOnShape(a,e),a}}static setColorExtensionsOnShape(e,t){"background-color"in t?e.extensions.fillColor=t["background-color"]:"fill"in t&&(e.extensions.fillColor=t.fill),"border-color"in t?e.extensions.strokeColor=t["border-color"]:"stroke"in t&&(e.extensions.strokeColor=t.stroke)}static deserializeBounds(e){const t=e.Bounds;if(t)return new Ks(t.x,t.y,t.width,t.height)}deserializeEdges(e){return m(e).map(t=>{const s=this.convertedElements.findSequenceFlow(t.bpmnElement)||this.convertedElements.findMessageFlow(t.bpmnElement)||this.convertedElements.findAssociationFlow(t.bpmnElement);if(!s){this.parsingMessageCollector.warning(new Vs(t.bpmnElement));return}const i=this.deserializeWaypoints(t.waypoint),o=this.deserializeLabel(t.BPMNLabel,t.id),r=t.messageVisibleKind?t.messageVisibleKind:ge.NONE,l=new zs(t.id,s,i,o,r);return Q.setColorExtensionsOnEdge(l,t),l}).filter(Boolean)}static setColorExtensionsOnEdge(e,t){"border-color"in t?e.extensions.strokeColor=t["border-color"]:"stroke"in t&&(e.extensions.strokeColor=t.stroke)}deserializeWaypoints(e){return m(e).map(t=>new Xs(t.x,t.y))}deserializeLabel(e,t){if(e&&typeof e=="object"){const s=this.findFont(e.labelStyle,t),i=Q.deserializeBounds(e),o=new $s(s,i);if("color"in e)return o.extensions.color=e.color,o;if(s||i)return o}}findFont(e,t){let s;return e&&(s=this.convertedFonts.get(e),s||this.parsingMessageCollector.warning(new Ys(t,e))),s}}class js{constructor(e){this.convertedElements=e}deserialize(e){for(const t of mt){const s=e[t+"EventDefinition"];for(const i of m(s,!0))this.convertedElements.registerEventDefinitionsOfDefinition(i.id,t)}}}class qs{constructor(e){this.convertedElements=e}deserialize(e){this.parseGlobalTasks(e.globalTask,h.GLOBAL_TASK),this.parseGlobalTasks(e.globalBusinessRuleTask,h.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(e.globalManualTask,h.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(e.globalScriptTask,h.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(e.globalUserTask,h.GLOBAL_TASK_USER)}parseGlobalTasks(e,t){for(const s of m(e))this.convertedElements.registerGlobalTask(s.id,t)}}const Qs=(n,e)=>{switch(n){case"adHocSubProcess":return W.AD_HOC;case"transaction":return W.TRANSACTION;default:return e.triggeredByEvent?W.EVENT:W.EMBEDDED}},Js=["adHocSubProcess","transaction",...C.flowNodeKinds().filter(n=>n!==h.EVENT_BOUNDARY),h.EVENT_BOUNDARY];function ei(n){return["adHocSubProcess","transaction"].includes(n)?h.SUB_PROCESS:n}class ti{constructor(e,t){g(this,"defaultSequenceFlowIds",[]);g(this,"elementsWithoutParentByProcessId",new Map);g(this,"callActivitiesCallingProcess",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){for(const t of m(e))this.parseProcess(t);for(const t of m(e))this.assignParentOfProcessElementsCalledByCallActivity(t.id);this.assignIncomingAndOutgoingIdsFromFlows()}assignParentOfProcessElementsCalledByCallActivity(e){const t=this.callActivitiesCallingProcess.get(e);if(t){const s=this.convertedElements.findPoolByProcessRef(e);s&&(s.parentId=t.id);for(const i of this.elementsWithoutParentByProcessId.get(e))i.parentId=t.id}}assignIncomingAndOutgoingIdsFromFlows(){const e=(t,s,i)=>{const o=this.convertedElements.findFlowNode(t)??this.convertedElements.findLane(t)??this.convertedElements.findPoolById(t);o&&!o[s].includes(i)&&o[s].push(i)};for(const t of this.convertedElements.getFlows())e(t.sourceReferenceId,"outgoingIds",t.id),e(t.targetReferenceId,"incomingIds",t.id)}parseProcess(e){const t=e.id,s=this.convertedElements.findPoolByProcessRef(t);s&&!s.name&&this.convertedElements.registerPool(new Y(s.id,e.name,h.POOL),t),this.buildProcessInnerElements(e,s==null?void 0:s.id)}buildProcessInnerElements(e,t){this.elementsWithoutParentByProcessId.set(e.id,[]);for(const s of Js)this.buildFlowNodeBpmnElements(e[s],ei(s),t,e.id,s);this.buildLaneSetBpmnElements(e.laneSet,t,e.id),this.buildSequenceFlows(e.sequenceFlow),this.buildAssociationFlows(e.association)}buildFlowNodeBpmnElements(e,t,s,i,o){for(const r of m(e)){const l=this.buildFlowNodeBpmnElement(t,r,s,o);"default"in r&&C.isWithDefaultSequenceFlow(t)&&this.defaultSequenceFlowIds.push(r.default),l&&(this.convertedElements.registerFlowNode(l),s||this.elementsWithoutParentByProcessId.get(i).push(l))}}buildFlowNodeBpmnElement(e,t,s,i){if(C.isEvent(e))return this.buildShapeBpmnEvent(t,e,s);if(C.isActivity(e))return this.buildShapeBpmnActivity(t,e,s,i);if(e==h.GATEWAY_EVENT_BASED){const o=t;return new Lt(o.id,o.name,s,o.instantiate,de[o.eventGatewayType])}else{if(e==h.GROUP)return xt(this.convertedElements,this.parsingMessageCollector,t,s);{const o=e===h.TEXT_ANNOTATION?t.text:t.name;return new Y(t.id,o,e,s,t.instantiate)}}}buildShapeBpmnActivity(e,t,s,i){const o=ni(e);return C.isSubProcess(t)?this.buildShapeBpmnSubProcess(e,s,Qs(i,e),o):C.isCallActivity(t)?this.buildShapeBpmnCallActivity(e,s,o):new Le(e.id,e.name,t,s,e.instantiate,o)}buildShapeBpmnCallActivity(e,t,s){const i=this.convertedElements.findGlobalTask(e.calledElement);if(!i){const o=new Z(e.id,e.name,ue.CALLING_PROCESS,t,s);return this.callActivitiesCallingProcess.set(e.calledElement,o),o}return new Z(e.id,e.name,ue.CALLING_GLOBAL_TASK,t,s,i)}buildShapeBpmnEvent(e,t,s){const i=this.getEventDefinitions(e),o=i.map(r=>r.counter).reduce((r,l)=>r+l,0);if(o==0&&C.canHaveNoneEvent(t))return new J(e.id,e.name,t,b.NONE,s);if(o==1){const r=i[0].kind;return C.isBoundaryEvent(t)?this.buildShapeBpmnBoundaryEvent(e,r):C.isStartEvent(t)?new Nt(e.id,e.name,r,s,e.isInterrupting):new J(e.id,e.name,t,r,s)}}buildShapeBpmnBoundaryEvent(e,t){const s=this.convertedElements.findFlowNode(e.attachedToRef);if(C.isActivity(s==null?void 0:s.kind))return new vt(e.id,e.name,t,e.attachedToRef,e.cancelActivity);this.parsingMessageCollector.warning(new Ws(e.id,e.attachedToRef,s==null?void 0:s.kind))}getEventDefinitions(e){const t=new Map;for(const s of mt){const i=e[s+"EventDefinition"],o=m(i,!0).length;t.set(s,o)}for(const s of m(e.eventDefinitionRef)){const i=this.convertedElements.findEventDefinitionOfDefinition(s);t.set(i,t.get(i)+1)}return[...t.entries()].filter(([,s])=>s>0).map(([s,i])=>({kind:s,counter:i}))}buildShapeBpmnSubProcess(e,t,s,i){const o=new fe(e.id,e.name,s,t,i);return this.buildProcessInnerElements(e,e.id),o}buildLaneSetBpmnElements(e,t,s){for(const i of m(e))this.buildLaneBpmnElements(i.lane,t,s)}buildLaneBpmnElements(e,t,s){var i;for(const o of m(e)){const r=new Y(o.id,o.name,h.LANE,t);this.convertedElements.registerLane(r),t||this.elementsWithoutParentByProcessId.get(s).push(r),this.assignParentOfLaneFlowNodes(o),(i=o.childLaneSet)!=null&&i.lane&&this.buildLaneBpmnElements(o.childLaneSet.lane,o.id,s)}}assignParentOfLaneFlowNodes(e){for(const t of m(e.flowNodeRef)){const s=this.convertedElements.findFlowNode(t),i=e.id;s?C.isBoundaryEvent(s.kind)||(s.parentId=i):this.parsingMessageCollector.warning(new Us(i,t))}}buildSequenceFlows(e){for(const t of m(e)){const s=this.getSequenceFlowKind(t);this.convertedElements.registerSequenceFlow(new It(t.id,t.name,t.sourceRef,t.targetRef,s))}}buildAssociationFlows(e){for(const t of m(e)){const s=t.associationDirection;this.convertedElements.registerAssociationFlow(new At(t.id,void 0,t.sourceRef,t.targetRef,s))}}getSequenceFlowKind(e){if(this.defaultSequenceFlowIds.includes(e.id))return V.DEFAULT;{const t=this.convertedElements.findFlowNode(e.sourceRef);if(t&&C.isWithDefaultSequenceFlow(t.kind)&&e.conditionExpression)return C.isActivity(t.kind)?V.CONDITIONAL_FROM_ACTIVITY:V.CONDITIONAL_FROM_GATEWAY}return V.NORMAL}}const ni=n=>{const e=[],t=n.standardLoopCharacteristics,s=m(n.multiInstanceLoopCharacteristics,!0)[0];return t!==void 0?e.push(w.LOOP):s&&e.push(s.isSequential?w.MULTI_INSTANCE_SEQUENTIAL:w.MULTI_INSTANCE_PARALLEL),e};class si{constructor(e,t,s,i,o,r){this.categoryConverter=e,this.collaborationConverter=t,this.eventDefinitionConverter=s,this.globalTaskConverter=i,this.processConverter=o,this.diagramConverter=r}parse(e){const t=e.definitions;return this.categoryConverter.deserialize(t),this.collaborationConverter.deserialize(t.collaboration),this.eventDefinitionConverter.deserialize(t),this.globalTaskConverter.deserialize(t),this.processConverter.deserialize(t.process),this.diagramConverter.deserialize(t.BPMNDiagram)}}function ii(n){const e=new Ds;return new si(new xs(e),new Hs(e,n),new js(e),new qs(e),new ti(e,n),new Q(e,n))}var Ke={},_e={};(function(n){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",t=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s="["+e+"]["+t+"]*",i=new RegExp("^"+s+"$"),o=function(l,a){const u=[];let d=a.exec(l);for(;d;){const f=[];f.startIndex=a.lastIndex-d[0].length;const T=d.length;for(let E=0;E"u")};n.isExist=function(l){return typeof l<"u"},n.isEmptyObject=function(l){return Object.keys(l).length===0},n.merge=function(l,a,u){if(a){const d=Object.keys(a),f=d.length;for(let T=0;T"&&n[o]!==" "&&n[o]!==" "&&n[o]!==`
-`&&n[o]!=="\r";o++)a+=n[o];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),o--),!fi(a)){let f;return a.trim().length===0?f="Invalid space after '<'.":f="Tag '"+a+"' is an invalid name.",y("InvalidTag",f,R(n,o))}const u=ai(n,o);if(u===!1)return y("InvalidAttr","Attributes for '"+a+"' have open quote.",R(n,o));let d=u.value;if(o=u.index,d[d.length-1]==="/"){const f=o-d.length;d=d.substring(0,d.length-1);const T=Tt(d,e);if(T===!0)s=!0;else return y(T.err.code,T.err.msg,R(n,f+T.err.line))}else if(l)if(u.tagClosed){if(d.trim().length>0)return y("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",R(n,r));{const f=t.pop();if(a!==f.tagName){let T=R(n,f.tagStartPos);return y("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+T.line+", col "+T.col+") instead of closing tag '"+a+"'.",R(n,r))}t.length==0&&(i=!0)}}else return y("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",R(n,o));else{const f=Tt(d,e);if(f!==!0)return y(f.err.code,f.err.msg,R(n,o-d.length+f.err.line));if(i===!0)return y("InvalidXml","Multiple possible root nodes found.",R(n,o));e.unpairedTags.indexOf(a)!==-1||t.push({tagName:a,tagStartPos:r}),s=!0}for(o++;o0)return y("InvalidXml","Invalid '"+JSON.stringify(t.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return y("InvalidXml","Start tag expected.",1);return!0};function ht(n){return n===" "||n===" "||n===`
-`||n==="\r"}function ft(n,e){const t=e;for(;e5&&s==="xml")return y("InvalidXml","XML declaration allowed only at the start of the document.",R(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function gt(n,e){if(n.length>e+5&&n[e+1]==="-"&&n[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(n.length>e+8&&n[e+1]==="D"&&n[e+2]==="O"&&n[e+3]==="C"&&n[e+4]==="T"&&n[e+5]==="Y"&&n[e+6]==="P"&&n[e+7]==="E"){let t=1;for(e+=8;e"&&(t--,t===0))break}else if(n.length>e+9&&n[e+1]==="["&&n[e+2]==="C"&&n[e+3]==="D"&&n[e+4]==="A"&&n[e+5]==="T"&&n[e+6]==="A"&&n[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}const ri='"',li="'";function ai(n,e){let t="",s="",i=!1;for(;e"&&s===""){i=!0;break}t+=n[e]}return s!==""?!1:{value:t,index:e,tagClosed:i}}const ci=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Tt(n,e){const t=ze.getAllMatches(n,ci),s={};for(let i=0;i!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n}},gi=function(n){return Object.assign({},Mt,n)};Xe.buildOptions=gi;Xe.defaultOptions=Mt;class Ti{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}var pi=Ti;const Ei=_e;function Si(n,e){const t={};if(n[e+3]==="O"&&n[e+4]==="C"&&n[e+5]==="T"&&n[e+6]==="Y"&&n[e+7]==="P"&&n[e+8]==="E"){e=e+9;let s=1,i=!1,o=!1,r="";for(;e"){if(o?n[e-1]==="-"&&n[e-2]==="-"&&(o=!1,s--):s--,s===0)break}else n[e]==="["?i=!0:r+=n[e];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:t,i:e}}function mi(n,e){let t="";for(;e0&&i&&t[2]!==".")return n;if(!e.leadingZeros&&o.length>0&&!i&&t[1]!==".")return n;{const a=Number(t),u=""+a;return u.search(/[eE]/)!==-1||l?e.eNotation?a:n:t.indexOf(".")!==-1?u==="0"&&r===""||u===r||i&&u==="-"+r?a:n:o?r===u||i+r===u?a:n:t===u||t===i+u?a:n}}else return n}}function Ri(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substr(0,n.length-1))),n}var Fi=bi;const $e=_e,ae=pi,Pi=Li,ki=Fi;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,$e.nameRegexp);let xi=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=Mi,this.parseXml=Ui,this.parseTextData=Bi,this.resolveNameSpace=Gi,this.buildAttributesMap=Yi,this.isItStopNode=Ki,this.replaceEntitiesValue=Di,this.readStopNodeData=Xi,this.saveTextToParentTag=Hi,this.addChild=Wi}};function Mi(n){const e=Object.keys(n);for(let t=0;t0)){r||(n=this.replaceEntitiesValue(n));const l=this.options.tagValueProcessor(e,n,t,i,o);return l==null?n:typeof l!=typeof n||l!==n?l:this.options.trimValues?Ye(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?Ye(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function Gi(n){if(this.options.removeNSPrefix){const e=n.split(":"),t=n.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(n=t+e[1])}return n}const Vi=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Yi(n,e,t){if(!this.options.ignoreAttributes&&typeof n=="string"){const s=$e.getAllMatches(n,Vi),i=s.length,o={};for(let r=0;r",o,"Closing Tag is not closed.");let a=n.substring(o+2,l).trim();if(this.options.removeNSPrefix){const f=a.indexOf(":");f!==-1&&(a=a.substr(f+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&(s=this.saveTextToParentTag(s,t,i));const u=i.substring(i.lastIndexOf(".")+1);if(a&&this.options.unpairedTags.indexOf(a)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: ${a}>`);let d=0;u&&this.options.unpairedTags.indexOf(u)!==-1?(d=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):d=i.lastIndexOf("."),i=i.substring(0,d),t=this.tagsNodeStack.pop(),s="",o=l}else if(n[o+1]==="?"){let l=Ve(n,o,!1,"?>");if(!l)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,t,i),!(this.options.ignoreDeclaration&&l.tagName==="?xml"||this.options.ignorePiTags)){const a=new ae(l.tagName);a.add(this.options.textNodeName,""),l.tagName!==l.tagExp&&l.attrExpPresent&&(a[":@"]=this.buildAttributesMap(l.tagExp,i,l.tagName)),this.addChild(t,a,i)}o=l.closeIndex+1}else if(n.substr(o+1,3)==="!--"){const l=$(n,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){const a=n.substring(o+4,l-2);s=this.saveTextToParentTag(s,t,i),t.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}o=l}else if(n.substr(o+1,2)==="!D"){const l=Pi(n,o);this.docTypeEntities=l.entities,o=l.i}else if(n.substr(o+1,2)==="!["){const l=$(n,"]]>",o,"CDATA is not closed.")-2,a=n.substring(o+9,l);if(s=this.saveTextToParentTag(s,t,i),this.options.cdataPropName)t.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]);else{let u=this.parseTextData(a,t.tagname,i,!0,!1,!0);u==null&&(u=""),t.add(this.options.textNodeName,u)}o=l+2}else{let l=Ve(n,o,this.options.removeNSPrefix),a=l.tagName;const u=l.rawTagName;let d=l.tagExp,f=l.attrExpPresent,T=l.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&s&&t.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,t,i,!1));const E=t;if(E&&this.options.unpairedTags.indexOf(E.tagname)!==-1&&(t=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),a!==e.tagname&&(i+=i?"."+a:a),this.isItStopNode(this.options.stopNodes,i,a)){let S="";if(d.length>0&&d.lastIndexOf("/")===d.length-1)o=l.closeIndex;else if(this.options.unpairedTags.indexOf(a)!==-1)o=l.closeIndex;else{const P=this.readStopNodeData(n,u,T+1);if(!P)throw new Error(`Unexpected end of ${u}`);o=P.i,S=P.tagContent}const B=new ae(a);a!==d&&f&&(B[":@"]=this.buildAttributesMap(d,i,a)),S&&(S=this.parseTextData(S,a,i,!0,f,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),B.add(this.options.textNodeName,S),this.addChild(t,B,i)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),d=a):d=d.substr(0,d.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const S=new ae(a);a!==d&&f&&(S[":@"]=this.buildAttributesMap(d,i,a)),this.addChild(t,S,i),i=i.substr(0,i.lastIndexOf("."))}else{const S=new ae(a);this.tagsNodeStack.push(t),a!==d&&f&&(S[":@"]=this.buildAttributesMap(d,i,a)),this.addChild(t,S,i),t=S}s="",o=T}}else s+=n[o];return e.child};function Wi(n,e,t){const s=this.options.updateTag(e.tagname,t,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),n.addChild(e))}const Di=function(n){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];n=n.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];n=n.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];n=n.replace(t.regex,t.val)}n=n.replace(this.ampEntity.regex,this.ampEntity.val)}return n};function Hi(n,e,t,s){return n&&(s===void 0&&(s=Object.keys(e.child).length===0),n=this.parseTextData(n,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,s),n!==void 0&&n!==""&&e.add(this.options.textNodeName,n),n=""),n}function Ki(n,e,t){const s="*."+t;for(const i in n){const o=n[i];if(s===o||e===o)return!0}return!1}function zi(n,e,t=">"){let s,i="";for(let o=e;o"){const i=zi(n,e+1,s);if(!i)return;let o=i.data;const r=i.index,l=o.search(/\s/);let a=o,u=!0;l!==-1&&(a=o.substr(0,l).replace(/\s\s*$/,""),o=o.substr(l+1));const d=a;if(t){const f=a.indexOf(":");f!==-1&&(a=a.substr(f+1),u=a!==i.data.substr(f+1))}return{tagName:a,tagExp:o,closeIndex:r,attrExpPresent:u,rawTagName:d}}function Xi(n,e,t){const s=t;let i=1;for(;t",t,`${e} is not closed`);if(n.substring(t+2,o).trim()===e&&(i--,i===0))return{tagContent:n.substring(s,t),i:o};t=o}else if(n[t+1]==="?")t=$(n,"?>",t+1,"StopNode is not closed.");else if(n.substr(t+1,3)==="!--")t=$(n,"-->",t+3,"StopNode is not closed.");else if(n.substr(t+1,2)==="![")t=$(n,"]]>",t,"StopNode is not closed.")-2;else{const o=Ve(n,t,">");o&&((o&&o.tagName)===e&&o.tagExp[o.tagExp.length-1]!=="/"&&i++,t=o.closeIndex)}}function Ye(n,e,t){if(e&&typeof n=="string"){const s=n.trim();return s==="true"?!0:s==="false"?!1:ki(n,t)}else return $e.isExist(n)?n:""}var $i=xi,Bt={};function Zi(n,e){return Gt(n,e)}function Gt(n,e,t){let s;const i={};for(let o=0;o0&&(i[e.textNodeName]=s):s!==void 0&&(i[e.textNodeName]=s),i}function ji(n){const e=Object.keys(n);for(let t=0;t0&&(t=oo),Vt(n,e,"",t)}function Vt(n,e,t,s){let i="",o=!1;for(let r=0;r`,o=!1;continue}else if(a===e.commentPropName){i+=s+``,o=!0;continue}else if(a[0]==="?"){const S=pt(l[":@"],e),B=a==="?xml"?"":s;let P=l[a][0][e.textNodeName];P=P.length!==0?" "+P:"",i+=B+`<${a}${P}${S}?>`,o=!0;continue}let d=s;d!==""&&(d+=e.indentBy);const f=pt(l[":@"],e),T=s+`<${a}${f}`,E=Vt(l[a],e,u,d);e.unpairedTags.indexOf(a)!==-1?e.suppressUnpairedNode?i+=T+">":i+=T+"/>":(!E||E.length===0)&&e.suppressEmptyNode?i+=T+"/>":E&&E.endsWith(">")?i+=T+`>${E}${s}${a}>`:(i+=T+">",E&&s!==""&&(E.includes("/>")||E.includes(""))?i+=s+e.indentBy+E+s:i+=E,i+=`${a}>`),o=!0}return i}function lo(n){const e=Object.keys(n);for(let t=0;t0&&e.processEntities)for(let t=0;t","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function z(n){this.options=Object.assign({},ho,n),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=To),this.processTextOrObjNode=fo,this.options.format?(this.indentate=go,this.tagEndChar=`>
+var tn=Object.defineProperty;var nn=(n,e,t)=>e in n?tn(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var g=(n,e,t)=>(nn(n,typeof e!="symbol"?e+"":e,t),t);import{f as sn}from"./mxgraph.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();var ce=(n=>(n.None="None",n.HorizontalVertical="HorizontalVertical",n.Horizontal="Horizontal",n.Vertical="Vertical",n.Center="Center",n))(ce||{}),on=(n=>(n.In="in",n.Out="out",n))(on||{});function rn(n){return n instanceof HTMLElement?n:document.querySelector(`#${n}`)}var h=(n=>(n.LANE="lane",n.POOL="pool",n.CALL_ACTIVITY="callActivity",n.SUB_PROCESS="subProcess",n.TASK="task",n.TASK_USER="userTask",n.TASK_SERVICE="serviceTask",n.TASK_RECEIVE="receiveTask",n.TASK_SEND="sendTask",n.TASK_MANUAL="manualTask",n.TASK_SCRIPT="scriptTask",n.TASK_BUSINESS_RULE="businessRuleTask",n.GLOBAL_TASK="globalTask",n.GLOBAL_TASK_USER="globalUserTask",n.GLOBAL_TASK_MANUAL="globalManualTask",n.GLOBAL_TASK_SCRIPT="globalScriptTask",n.GLOBAL_TASK_BUSINESS_RULE="globalBusinessRuleTask",n.GROUP="group",n.TEXT_ANNOTATION="textAnnotation",n.GATEWAY_PARALLEL="parallelGateway",n.GATEWAY_EXCLUSIVE="exclusiveGateway",n.GATEWAY_INCLUSIVE="inclusiveGateway",n.GATEWAY_EVENT_BASED="eventBasedGateway",n.GATEWAY_COMPLEX="complexGateway",n.EVENT_START="startEvent",n.EVENT_END="endEvent",n.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",n.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",n.EVENT_BOUNDARY="boundaryEvent",n))(h||{}),ue=(n=>(n.CALLING_PROCESS="process",n.CALLING_GLOBAL_TASK="global task",n))(ue||{}),de=(n=>(n.Exclusive="Exclusive",n.None="None",n.Parallel="Parallel",n))(de||{}),R=(n=>(n.NONE="none",n.TERMINATE="terminate",n.CANCEL="cancel",n.COMPENSATION="compensate",n.CONDITIONAL="conditional",n.ERROR="error",n.ESCALATION="escalation",n.LINK="link",n.MESSAGE="message",n.SIGNAL="signal",n.TIMER="timer",n))(R||{}),w=(n=>(n.ADHOC="adhoc",n.COMPENSATION="compensation",n.EXPAND="expand",n.LOOP="loop",n.MULTI_INSTANCE_PARALLEL="parallel multi instance",n.MULTI_INSTANCE_SEQUENTIAL="sequential multi instance",n))(w||{}),D=(n=>(n.AD_HOC="ad_hoc",n.EMBEDDED="embedded",n.EVENT="event",n.TRANSACTION="transaction",n))(D||{});function ln(n,e){return n===""?e?{}:void 0:n}function C(n,e=!1){return n==null?[]:(Array.isArray(n)?n:[n]).map(t=>ln(t,e)).filter(Boolean)}function an(n,e,t){const s=[];t!=null&&t.startingWith?s.push(`^(${t.startingWith}).*`):t!=null&&t.notStartingWith&&s.push(`^(?!(${t.notStartingWith})).*`),s.push(`${e}$`);const i=s.join("");return n.filter(o=>t!=null&&t.ignoreCase?new RegExp(i,"i").test(o):new RegExp(i).test(o))}class I{static isEvent(e){return Ee(it,e)}static eventKinds(){return[...it]}static isBoundaryEvent(e){return h.EVENT_BOUNDARY===e}static isStartEvent(e){return h.EVENT_START===e}static isCatchEvent(e){return h.EVENT_INTERMEDIATE_CATCH===e||h.EVENT_BOUNDARY===e||h.EVENT_START===e}static isIntermediateCatchEvent(e){return h.EVENT_INTERMEDIATE_CATCH===e}static isIntermediateThrowEvent(e){return h.EVENT_INTERMEDIATE_THROW===e}static isCallActivity(e){return h.CALL_ACTIVITY===e}static isSubProcess(e){return h.SUB_PROCESS===e}static canHaveNoneEvent(e){return h.EVENT_INTERMEDIATE_THROW===e||h.EVENT_END===e||h.EVENT_START===e}static isActivity(e){return Ee(xe,e)}static activityKinds(){return[...xe]}static isWithDefaultSequenceFlow(e){return cn.has(e)}static isTask(e){return Ee(ke,e)}static taskKinds(){return[...ke]}static gatewayKinds(){return[...ot]}static isGateway(e){return Ee(ot,e)}static flowNodeKinds(){return Object.values(h).filter(e=>!I.isPoolOrLane(e))}static isPoolOrLane(e){return e==h.POOL||e==h.LANE}}function He(n,e){return an(Object.values(h),n,e)}function Ee(n,e){return Object.values(n).map(t=>t).includes(e)}const it=He("Event"),ot=He("Gateway"),ke=He("Task",{ignoreCase:!0,notStartingWith:"global"}),xe=[...ke,h.CALL_ACTIVITY,h.SUB_PROCESS],cn=new Set([...xe,h.GATEWAY_EXCLUSIVE,h.GATEWAY_INCLUSIVE,h.GATEWAY_COMPLEX]),At=Object.values(R).filter(n=>n!=R.NONE);var q=(n=>(n.NONE="None",n.ONE="One",n.BOTH="Both",n))(q||{}),M=(n=>(n.SEQUENCE_FLOW="sequenceFlow",n.MESSAGE_FLOW="messageFlow",n.ASSOCIATION_FLOW="association",n))(M||{}),ge=(n=>(n.NONE="none",n.INITIATING="initiating",n.NON_INITIATING="non_initiating",n))(ge||{}),V=(n=>(n.NORMAL="normal",n.DEFAULT="default",n.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",n.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway",n))(V||{});class ve{constructor(e,t,s,i,o){this.id=e,this.name=t,this.kind=s,this.sourceReferenceId=i,this.targetReferenceId=o}}class Ot extends ve{constructor(e,t,s,i,o=V.NORMAL){super(e,t,M.SEQUENCE_FLOW,s,i),this.sequenceFlowKind=o}}class Nt extends ve{constructor(e,t,s,i){super(e,t,M.MESSAGE_FLOW,s,i)}}class vt extends ve{constructor(e,t,s,i,o=q.NONE){super(e,t,M.ASSOCIATION_FLOW,s,i),this.associationDirectionKind=o}}const L=un(),v=L.mxCellRenderer,Lt=L.mxClient,c=L.mxConstants,W=L.mxEvent,rt=L.mxPerimeter,x=L.mxPoint,Me=L.mxRectangle,Ke=L.mxRectangleShape,he=L.mxSvgCanvas2D,O=L.mxUtils;function un(){return window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",sn({})}class dn{constructor(e){this.graph=e}computeRelativeCoordinates(e,t){const s=this.getTranslateForRoot(e),i=t.x+s.x,o=t.y+s.y;return new x(i,o)}getTranslateForRoot(e){const t=this.graph.getModel(),s=new x(0,0);for(;e!=null;){const i=t.getGeometry(e);i!=null&&(s.x-=i.x,s.y-=i.y),e=t.getParent(e)}return s}computeEdgeCenter(e){const t=e.geometry.points,s=t[0],i=t.at(-1);if(s!=null&&i!=null){const o=i.x-s.x,r=i.y-s.y;return new x(s.x+o/2,s.y+r/2)}}}class Ie{constructor(e,t,s,i,o){g(this,"extensions",{});this.id=e,this.bpmnElement=t,this.bounds=s,this.label=i,this.isHorizontal=o}}class Y{constructor(e,t,s,i,o=!1){g(this,"incomingIds",[]);g(this,"outgoingIds",[]);this.id=e,this.name=t,this.kind=s,this.parentId=i,this.instantiate=o}}class Le extends Y{constructor(e,t,s,i,o,r=[]){super(e,t,s,i,o),this.markers=r}}class j extends Le{constructor(e,t,s,i,o,r){super(e,t,h.CALL_ACTIVITY,i,void 0,o),this.callActivityKind=s,this.globalTaskKind=r}}class fe extends Le{constructor(e,t,s,i,o){s==D.AD_HOC&&!o.includes(w.ADHOC)&&o.push(w.ADHOC),super(e,t,h.SUB_PROCESS,i,void 0,o),this.subProcessKind=s}}class K extends Y{constructor(e,t,s,i,o){super(e,t,s,o),this.eventDefinitionKind=i}}class Be extends K{constructor(t,s,i,o){super(t,s,h.EVENT_INTERMEDIATE_CATCH,i,o);g(this,"sourceIds",[])}}class Ge extends K{constructor(t,s,i,o){super(t,s,h.EVENT_INTERMEDIATE_THROW,i,o);g(this,"targetId")}}class yt extends K{constructor(e,t,s,i,o){super(e,t,h.EVENT_START,s,i),this.isInterrupting=o}}class _t extends K{constructor(e,t,s,i,o=!0){super(e,t,h.EVENT_BOUNDARY,s,i),this.isInterrupting=o}}class wt extends Y{constructor(e,t,s,i,o=de.None){super(e,t,h.GATEWAY_EVENT_BASED,s,i),this.gatewayKind=o}}function me(n,e,t,s){return Math.min(Math.max(n??s,e),t)}function hn(n){return Math.max(n??0,0)}function fn(n){const e=n??{};return e.debounceDelay=me(e.debounceDelay,0,100,50),e.throttleDelay=me(e.throttleDelay,0,100,50),e}function ye(n){return n=="default"?void 0:me(n,0,100,100)}function gn(n){return n=="default"?void 0:me(n,1,50,1)}const m={EDGE:"bpmn.edge",EDGE_START_FILL_COLOR:"bpmn.edge.startFillColor",EDGE_END_FILL_COLOR:"bpmn.edge.endFillColor",EVENT_BASED_GATEWAY_KIND:"bpmn.gatewayKind",EVENT_DEFINITION_KIND:"bpmn.eventDefinitionKind",GLOBAL_TASK_KIND:"bpmn.globalTaskKind",SUB_PROCESS_KIND:"bpmn.subProcessKind",IS_INITIATING:"bpmn.isInitiating",IS_INSTANTIATING:"bpmn.isInstantiating",IS_INTERRUPTING:"bpmn.isInterrupting",EXTRA_CSS_CLASSES:"bpmn.extra.css.classes",MARKERS:"bpmn.markers",MESSAGE_FLOW_ICON:"bpmn.messageFlowIcon"},Rt={ARROW_DASH:"bpmn.dash"},p={STROKE_WIDTH_THIN:2,STROKE_WIDTH_THICK:5,SHAPE_ACTIVITY_BOTTOM_MARGIN:7,SHAPE_ACTIVITY_TOP_MARGIN:7,SHAPE_ACTIVITY_LEFT_MARGIN:7,SHAPE_ACTIVITY_FROM_CENTER_MARGIN:7,SHAPE_ACTIVITY_MARKER_ICON_MARGIN:5,SHAPE_ACTIVITY_MARKER_ICON_SIZE:20,POOL_LABEL_SIZE:30,POOL_LABEL_FILL_COLOR:"none",LANE_LABEL_SIZE:30,LANE_LABEL_FILL_COLOR:"none",SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET:4,SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE:6,TEXT_ANNOTATION_BORDER_LENGTH:10,TEXT_ANNOTATION_FILL_COLOR:"none",GROUP_FILL_COLOR:"none",DEFAULT_FILL_COLOR:"White",DEFAULT_STROKE_COLOR:"Black",DEFAULT_FONT_FAMILY:"Arial, Helvetica, sans-serif",DEFAULT_FONT_SIZE:11,DEFAULT_FONT_COLOR:"Black",DEFAULT_MARGIN:0,SHAPE_ARC_SIZE:20,DEFAULT_OVERLAY_FILL_COLOR:"White",DEFAULT_OVERLAY_FILL_OPACITY:100,DEFAULT_OVERLAY_STROKE_COLOR:"Black",DEFAULT_OVERLAY_STROKE_WIDTH:1,DEFAULT_OVERLAY_FONT_SIZE:11,DEFAULT_OVERLAY_FONT_COLOR:"Black",SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_START_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_END_FILL_COLOR:"White"},bt=n=>O.getValue(n,m.IS_INSTANTIATING,"false")=="true",Ce=n=>n=="default"?void 0:n,Tn=(n,e)=>(e&&(n=F(n,c.STYLE_STROKECOLOR,e.color,Ce),n=F(n,c.STYLE_STROKE_OPACITY,e.opacity,ye),n=F(n,c.STYLE_STROKEWIDTH,e.width,gn)),n),F=(n,e,t,s=i=>i)=>t==null?n:O.setStyle(n,e,s(t)),Se=(n,e,t,s)=>s==null?n:O.setStyleFlag(n,e,t,s),pn=(n,e)=>(e&&(n=F(n,c.STYLE_FONTCOLOR,e.color,Ce),n=F(n,c.STYLE_FONTSIZE,e.size),n=F(n,c.STYLE_FONTFAMILY,e.family),n=Se(n,c.STYLE_FONTSTYLE,c.FONT_BOLD,e.isBold),n=Se(n,c.STYLE_FONTSTYLE,c.FONT_ITALIC,e.isItalic),n=Se(n,c.STYLE_FONTSTYLE,c.FONT_UNDERLINE,e.isUnderline),n=Se(n,c.STYLE_FONTSTYLE,c.FONT_STRIKETHROUGH,e.isStrikeThrough),n=F(n,c.STYLE_TEXT_OPACITY,e.opacity,ye)),n),En=(n,e,t)=>(n==null?void 0:n.split(";").map(s=>s.split("=")).filter(([s])=>s===e).map(([,s])=>s)[0])??t,Sn=n=>{switch(n){case"right-to-left":return c.DIRECTION_WEST;case"bottom-to-top":return c.DIRECTION_NORTH;case"top-to-bottom":return c.DIRECTION_SOUTH;default:return c.DIRECTION_EAST}},In=(n,e)=>{const t=e.color;if(t){const s=Cn(t),i=s?t.startColor:t;n=F(n,c.STYLE_FILLCOLOR,i,Ce),s?(n=O.setStyle(n,c.STYLE_GRADIENTCOLOR,t.endColor),n=O.setStyle(n,c.STYLE_GRADIENT_DIRECTION,Sn(t.direction))):t==="default"&&(n=O.setStyle(n,c.STYLE_GRADIENTCOLOR,void 0),n=O.setStyle(n,c.STYLE_GRADIENT_DIRECTION,void 0)),(n.includes(h.POOL)||n.includes(h.LANE))&&(n=F(n,c.STYLE_SWIMLANE_FILLCOLOR,i,Ce))}return n=F(n,c.STYLE_FILL_OPACITY,e.opacity,ye),n},mn=n=>n&&typeof n=="object"&&"fill"in n,Cn=n=>n&&typeof n=="object";class Q{constructor(e){g(this,"ignoreBpmnColors");this.ignoreBpmnColors=(e==null?void 0:e.ignoreBpmnColors)??!0}computeStyle(e,t){const s=[e.bpmnElement.kind];let i;e instanceof Ie?i=this.computeShapeStyleValues(e):(s.push(...Q.computeEdgeBaseStyles(e)),i=this.computeEdgeStyleValues(e));const o=this.computeFontStyleValues(e),r=Q.computeLabelStyleValues(e,t);return s.push(...lt([...i,...o,...r])),s.join(";")}computeShapeStyleValues(e){const t=new Map,s=e.bpmnElement;if(s instanceof K?Q.computeEventShapeStyle(s,t):s instanceof Le?Q.computeActivityShapeStyle(s,t):I.isPoolOrLane(s.kind)?t.set(c.STYLE_HORIZONTAL,e.isHorizontal?"0":"1"):s instanceof wt&&(t.set(m.IS_INSTANTIATING,String(s.instantiate)),t.set(m.EVENT_BASED_GATEWAY_KIND,String(s.gatewayKind))),!this.ignoreBpmnColors){const i=e.extensions,o=i.fillColor;o&&(t.set(c.STYLE_FILLCOLOR,o),I.isPoolOrLane(s.kind)&&t.set(c.STYLE_SWIMLANE_FILLCOLOR,o)),i.strokeColor&&t.set(c.STYLE_STROKECOLOR,i.strokeColor)}return t}static computeEventShapeStyle(e,t){t.set(m.EVENT_DEFINITION_KIND,e.eventDefinitionKind),(e instanceof _t||e instanceof yt&&e.isInterrupting!==void 0)&&t.set(m.IS_INTERRUPTING,String(e.isInterrupting))}static computeActivityShapeStyle(e,t){e instanceof fe?t.set(m.SUB_PROCESS_KIND,e.subProcessKind):e.kind===h.TASK_RECEIVE?t.set(m.IS_INSTANTIATING,String(e.instantiate)):e instanceof j&&t.set(m.GLOBAL_TASK_KIND,e.globalTaskKind);const s=e.markers;s.length>0&&t.set(m.MARKERS,s.join(","))}static computeEdgeBaseStyles(e){const t=[],s=e.bpmnElement;return s instanceof Ot&&t.push(s.sequenceFlowKind),s instanceof vt&&t.push(s.associationDirectionKind),t}computeEdgeStyleValues(e){const t=new Map;if(!this.ignoreBpmnColors){const s=e.extensions;s.strokeColor&&t.set(c.STYLE_STROKECOLOR,s.strokeColor)}return t}computeFontStyleValues(e){var i,o;const t=new Map,s=(i=e.label)==null?void 0:i.font;if(s&&(t.set(c.STYLE_FONTFAMILY,s.name),t.set(c.STYLE_FONTSIZE,s.size),t.set(c.STYLE_FONTSTYLE,An(s))),!this.ignoreBpmnColors){const r=(o=e.label)==null?void 0:o.extensions;r!=null&&r.color&&t.set(c.STYLE_FONTCOLOR,r.color)}return t}static computeLabelStyleValues(e,t){const s=new Map,i=e.bpmnElement;return t?(s.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),e.bpmnElement.kind!=h.TEXT_ANNOTATION&&s.set(c.STYLE_ALIGN,c.ALIGN_CENTER),e instanceof Ie&&(s.set(c.STYLE_LABEL_WIDTH,t.width+1),s.set(c.STYLE_LABEL_POSITION,"ignore"),s.set(c.STYLE_VERTICAL_LABEL_POSITION,c.ALIGN_MIDDLE))):e instanceof Ie&&(i instanceof fe||i instanceof j&&i.callActivityKind===ue.CALLING_PROCESS)&&!i.markers.includes(w.EXPAND)&&s.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),s}computeMessageFlowIconStyle(e){const t=[];return t.push(["shape",m.MESSAGE_FLOW_ICON],[m.IS_INITIATING,String(e.messageVisibleKind===ge.INITIATING)]),this.ignoreBpmnColors||e.extensions.strokeColor&&t.push([c.STYLE_STROKECOLOR,e.extensions.strokeColor]),lt(t).join(";")}}function An(n){let e=0;return n.isBold&&(e+=c.FONT_BOLD),n.isItalic&&(e+=c.FONT_ITALIC),n.isStrikeThrough&&(e+=c.FONT_STRIKETHROUGH),n.isUnderline&&(e+=c.FONT_UNDERLINE),e}function lt(n){return n.filter(([,e])=>e&&e!="undefined").map(([e,t])=>`${e}=${t}`)}class On{constructor(e,t,s){this.graph=e,this.coordinatesTranslator=t,this.styleComputer=s}render(e,t){this.insertShapesAndEdges(e),this.graph.customFit(t)}insertShapesAndEdges({pools:e,lanes:t,subprocesses:s,otherFlowNodes:i,boundaryEvents:o,edges:r}){this.graph.batchUpdate(()=>{this.graph.getModel().clear(),this.insertShapes(e),this.insertShapes(t),this.insertShapes(s),this.insertShapes(i),this.insertShapes(o),this.insertEdges(r)})}insertShapes(e){for(const t of e)this.insertShape(t)}getParent(e){return this.getCell(e.parentId)??this.graph.getDefaultParent()}insertShape(e){var l;const t=e.bpmnElement,s=this.getParent(t),i=e.bounds;let o=(l=e.label)==null?void 0:l.bounds;o=I.isPoolOrLane(t.kind)?void 0:o;const r=this.styleComputer.computeStyle(e,o);this.insertVertex(s,t.id,t.name,i,o,r)}insertEdges(e){var t;for(const s of e){const i=s.bpmnElement,o=this.graph.getDefaultParent(),r=this.getCell(i.sourceReferenceId),l=this.getCell(i.targetReferenceId),a=(t=s.label)==null?void 0:t.bounds,u=this.styleComputer.computeStyle(s,a),d=this.graph.insertEdge(o,i.id,i.name,r,l,u);if(this.insertWaypoints(s.waypoints,d),a){d.geometry.width=a.width,d.geometry.height=a.height;const f=this.coordinatesTranslator.computeEdgeCenter(d);if(f){d.geometry.relative=!1;const T=this.coordinatesTranslator.computeRelativeCoordinates(d.parent,new x(a.x,a.y)),E=T.x+a.width/2-f.x,S=T.y-f.y;d.geometry.offset=new x(E,S)}}this.insertMessageFlowIconIfNeeded(s,d)}}insertMessageFlowIconIfNeeded(e,t){if(e.bpmnElement instanceof Nt&&e.messageVisibleKind!==ge.NONE){const s=this.graph.insertVertex(t,ze(t.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(e));s.geometry.relative=!0,s.geometry.offset=new x(-10,-7)}}insertWaypoints(e,t){e&&(t.geometry.points=e.map(s=>this.coordinatesTranslator.computeRelativeCoordinates(t.parent,new x(s.x,s.y))))}getCell(e){return this.graph.getModel().getCell(e)}insertVertex(e,t,s,i,o,r){const l=this.coordinatesTranslator.computeRelativeCoordinates(e,new x(i.x,i.y)),a=this.graph.insertVertex(e,t,s,l.x,l.y,i.width,i.height,r);if(o){const u=o.x-i.x,d=o.y-i.y;a.geometry.offset=new x(u,d)}return a}}function Nn(n,e){return new On(n,new dn(n),new Q(e))}function ze(n){return`messageFlowIcon_of_${n}`}var vn=typeof global=="object"&&global&&global.Object===Object&&global;const Ln=vn;var yn=typeof self=="object"&&self&&self.Object===Object&&self,_n=Ln||yn||Function("return this")();const Ft=_n;var wn=Ft.Symbol;const Ae=wn;var Pt=Object.prototype,Rn=Pt.hasOwnProperty,bn=Pt.toString,re=Ae?Ae.toStringTag:void 0;function Fn(n){var e=Rn.call(n,re),t=n[re];try{n[re]=void 0;var s=!0}catch{}var i=bn.call(n);return s&&(e?n[re]=t:delete n[re]),i}var Pn=Object.prototype,kn=Pn.toString;function xn(n){return kn.call(n)}var Mn="[object Null]",Bn="[object Undefined]",at=Ae?Ae.toStringTag:void 0;function Gn(n){return n==null?n===void 0?Bn:Mn:at&&at in Object(n)?Fn(n):xn(n)}function Vn(n){return n!=null&&typeof n=="object"}var Yn="[object Symbol]";function Un(n){return typeof n=="symbol"||Vn(n)&&Gn(n)==Yn}var Dn=/\s/;function Wn(n){for(var e=n.length;e--&&Dn.test(n.charAt(e)););return e}var Hn=/^\s+/;function Kn(n){return n&&n.slice(0,Wn(n)+1).replace(Hn,"")}function Oe(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var ct=0/0,zn=/^[-+]0x[0-9a-f]+$/i,Xn=/^0b[01]+$/i,$n=/^0o[0-7]+$/i,Zn=parseInt;function ut(n){if(typeof n=="number")return n;if(Un(n))return ct;if(Oe(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Oe(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Kn(n);var t=Xn.test(n);return t||$n.test(n)?Zn(n.slice(2),t?2:8):zn.test(n)?ct:+n}var jn=function(){return Ft.Date.now()};const Re=jn;var qn="Expected a function",Qn=Math.max,Jn=Math.min;function kt(n,e,t){var s,i,o,r,l,a,u=0,d=!1,f=!1,T=!0;if(typeof n!="function")throw new TypeError(qn);e=ut(e)||0,Oe(t)&&(d=!!t.leading,f="maxWait"in t,o=f?Qn(ut(t.maxWait)||0,e):o,T="trailing"in t?!!t.trailing:T);function E(_){var U=s,oe=i;return s=i=void 0,u=_,r=n.apply(oe,U),r}function S(_){return u=_,l=setTimeout(pe,e),d?E(_):r}function B(_){var U=_-a,oe=_-u,st=e-U;return f?Jn(st,o-oe):st}function P(_){var U=_-a,oe=_-u;return a===void 0||U>=e||U<0||f&&oe>=o}function pe(){var _=Re();if(P(_))return nt(_);l=setTimeout(pe,B(_))}function nt(_){return l=void 0,T&&s?E(_):(s=i=void 0,r)}function Jt(){l!==void 0&&clearTimeout(l),u=0,s=a=i=l=void 0}function en(){return l===void 0?r:nt(Re())}function we(){var _=Re(),U=P(_);if(s=arguments,i=this,a=_,U){if(l===void 0)return S(a);if(f)return clearTimeout(l),l=setTimeout(pe,e),E(a)}return l===void 0&&(l=setTimeout(pe,e)),r}return we.cancel=Jt,we.flush=en,we}var es="Expected a function";function ts(n,e,t){var s=!0,i=!0;if(typeof n!="function")throw new TypeError(es);return Oe(t)&&(s="leading"in t?!!t.leading:s,i="trailing"in t?!!t.trailing:i),kt(n,e,{leading:s,maxWait:e,trailing:i})}class xt extends L.mxCellOverlay{constructor(t,s){super(null,"",s.position.horizontalAlign,s.position.verticalAlign,null,"default");g(this,"style");this.label=t,this.style=s.style}getBounds(t){const s=t.view.graph.getModel().isEdge(t.cell),i=t.view.scale;let o;const r=0,l=0;return s?o=this.computeEdgeBounds(t):(o=new x,this.align==c.ALIGN_LEFT?o.x=t.x:this.align==c.ALIGN_CENTER?o.x=t.x+t.width/2:o.x=t.x+t.width,this.verticalAlign==c.ALIGN_TOP?o.y=t.y:this.verticalAlign==c.ALIGN_MIDDLE?o.y=t.y+t.height/2:o.y=t.y+t.height),new Me(Math.round(o.x-(r*this.defaultOverlap-this.offset.x)*i),Math.round(o.y-(l*this.defaultOverlap-this.offset.y)*i),r*i,l*i)}computeEdgeBounds(t){const s=t.absolutePoints;if(this.align==c.ALIGN_LEFT)return s[0];if(this.align==c.ALIGN_CENTER){if(s.length%2==1)return s[Math.floor(s.length/2)];{const i=s.length/2,o=s[i-1],r=s[i];return new x(o.x+(r.x-o.x)/2,o.y+(r.y-o.y)/2)}}else return s.at(-1)}}class dt extends L.mxText{constructor(e,t,s){super(e,t,void 0,void 0,s.font.color,void 0,s.font.size,void 0,void 0,void 0,void 0,void 0,void 0,void 0,s.fill.color,s.stroke.color),this.fillOpacity=s.fill.opacity,this.strokewidth=s.stroke.width}}class ns extends L.mxCellRenderer{createCellOverlays(e){const s=e.view.graph.getCellOverlays(e.cell);let i=null;if(s!=null){i=new L.mxDictionary;for(const o of s){const r=e.overlays==null?null:e.overlays.remove(o);if(r!=null){i.put(o,r);continue}let l;o instanceof xt?l=new dt(o.label,new Me(0,0,0,0),o.style):(l=new L.mxImageShape(new Me(0,0,0,0),o.image.src),l.preserveImageAspect=!1),l.dialect=e.view.graph.dialect,l.overlay=o,this.initializeOverlay(e,l),this.installCellOverlayListeners(e,o,l),o.cursor!=null&&(l.node.style.cursor=o.cursor),l instanceof dt&&(l.node.classList.add("overlay-badge"),l.node.dataset.bpmnId=e.cell.id),i.put(o,l)}}e.overlays!=null&&e.overlays.visit(function(o,r){r.destroy()}),e.overlays=i}}const Ve=1.25,ss=1/Ve;class is extends L.mxGraph{constructor(t){super(t);g(this,"currentZoomLevel",1);this.zoomFactor=Ve,this.container&&(this.container.style.cursor="default")}createGraphView(){return new os(this)}createCellRenderer(){return new ns}batchUpdate(t){this.model.beginUpdate();try{t()}finally{this.model.endUpdate()}}fit(t,s,i,o,r,l,a){const u=super.fit(t,s,i,o,r,l,a);return this.setCurrentZoomLevel(u),u}setCurrentZoomLevel(t){this.currentZoomLevel=t??this.view.scale}zoomActual(){super.zoomActual(),this.setCurrentZoomLevel()}zoomIn(){super.zoomIn(),this.setCurrentZoomLevel()}zoomOut(){super.zoomOut(),this.setCurrentZoomLevel()}customFit(t){this.zoomActual();const s=t==null?void 0:t.type;if(s==null||s==ce.None)return;const i=hn(t==null?void 0:t.margin);if(s==ce.Center){const r=this.getGraphBounds(),l=this.container.clientWidth-i,a=this.container.clientHeight-i,u=r.width/this.view.scale,d=r.height/this.view.scale,f=Math.min(3,Math.min(l/u,a/d));this.setCurrentZoomLevel(f),this.view.scaleAndTranslate(f,(i+l-u*f)/(2*f)-r.x/this.view.scale,(i+a-d*f)/(2*f)-r.y/this.view.scale)}else{let o=!1,r=!1;switch(s){case ce.Horizontal:{r=!0;break}case ce.Vertical:{o=!0;break}}this.fit(this.border,!1,i,!0,o,r)}}registerMouseWheelZoomListeners(t){t=fn(t),W.addMouseWheelListener(kt(this.createMouseWheelZoomListener(!0),t.debounceDelay),this.container),W.addMouseWheelListener(ts(this.createMouseWheelZoomListener(!1),t.throttleDelay),this.container)}manageMouseWheelZoomEvent(t,s,i){if(i){const[o,r]=this.getEventRelativeCoordinates(s),[l,a,u]=this.getScaleAndTranslationDeltas(o,r);this.view.scaleAndTranslate(l,this.view.translate.x+a,this.view.translate.y+u),W.consume(s)}else this.currentZoomLevel*=t?Ve:ss}createMouseWheelZoomListener(t){return(s,i)=>{if(W.isConsumed(s)||!(s instanceof MouseEvent))return;s.ctrlKey&&!s.altKey&&!s.shiftKey&&!s.metaKey&&this.manageMouseWheelZoomEvent(i,s,t)}}getEventRelativeCoordinates(t){const s=this.container.getBoundingClientRect(),i=t.clientX-s.left,o=t.clientY-s.top;return[i,o]}getScaleAndTranslationDeltas(t,s){const[i,o]=this.calculateFactorAndScale(),[r,l]=this.calculateTranslationDeltas(i,o,t*2,s*2);return[o,r,l]}calculateTranslationDeltas(t,s,i,o){if(t>1){const r=(t-1)/(s*2);i*=-r,o*=-r}else{const r=(1/t-1)/(this.view.scale*2);i*=r,o*=r}return[i,o]}calculateFactorAndScale(){const t=Math.round(this.currentZoomLevel*100)/100;return[t/this.view.scale,t]}}class os extends L.mxGraphView{getFloatingTerminalPoint(e,t,s,i){if(e.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(e,t,s,i);const l=e.absolutePoints;return i?l[1]:l.at(-2)}}class rs{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){const e=(t,s,i,o,r,l,a,u,d)=>{const f=r*(a+d+4),T=l*(a+d+4);return function(){t.begin(),t.moveTo(o.x-f/2-T/2,o.y-T/2+f/2),t.lineTo(o.x+T/2-3*f/2,o.y-3*T/2-f/2),t.stroke()}};L.mxMarker.addMarker(Rt.ARROW_DASH,e)}}function ls(n){return Object.values(M).map(e=>e).includes(n)}function as(n,e){return cs(n.style,e)}function cs(n,e){const t=[],s=n.split(";"),o=s[0].replace(/shape=bpmn./g,""),r=new Map;r.set("bpmn-type-activity",I.isActivity(o)),r.set("bpmn-type-container",I.isPoolOrLane(o)),r.set("bpmn-type-event",I.isEvent(o)),r.set("bpmn-type-flow",ls(o)),r.set("bpmn-type-gateway",I.isGateway(o)),r.set("bpmn-type-task",I.isTask(o));for(const[l]of[...r].filter(([,a])=>a))t.push(l);t.push(Ye(o));for(const[l,a]of s.map(u=>{const d=u.split("=");return[d[0],d[1]]}))switch(l){case m.EVENT_DEFINITION_KIND:{t.push(`bpmn-event-def-${a}`);break}case m.EVENT_BASED_GATEWAY_KIND:{t.push(`bpmn-gateway-kind-${a.toLowerCase()}`);break}case m.IS_INITIATING:{t.push(a=="true"?"bpmn-icon-initiating":"bpmn-icon-non-initiating");break}case m.SUB_PROCESS_KIND:{t.push(`bpmn-sub-process-${a.toLowerCase()}`);break}case m.GLOBAL_TASK_KIND:{t.push(Ye(a));break}}return e&&t.push("bpmn-label"),t}function Ye(n){return n?"bpmn-"+n.replace(/([A-Z])/g,e=>"-"+e[0].toLowerCase()):""}function us(n,e,t,s){let i,o;n.heightE.setIconOriginForIconCentered(),shapeConfig:{x:e,y:t,width:s,height:i,strokeWidth:u},iconStyleConfig:{isFilled:l,fillColor:d,strokeColor:f,strokeWidth:a,margin:T}}}class ${paintEmptyIcon(){}newBpmnCanvas({canvas:e,ratioFromParent:t,setIconOriginFunct:s,shapeConfig:i,iconStyleConfig:o},r){return new ds({canvas:e,shapeConfig:i,iconConfig:{originalSize:r,styleConfig:o,ratioFromParent:t,setIconOriginFunct:s}})}paintEnvelopeIcon(e){const t={width:485.41,height:321.76},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;s.rect(0,0,i,o),s.fillAndStroke();const{iconStyleConfig:r}=e;r.isFilled&&s.setStrokeColor(r.fillColor),s.begin(),s.moveTo(0,0),s.lineTo(i*.5,o*.6),s.lineTo(i,0),s.moveTo(0,o),s.lineTo(i/3,o*.45),s.moveTo(i,o),s.lineTo(i*2/3,o*.45),s.stroke()}paintCircleIcon(e){const t={width:e.shapeConfig.width,height:e.shapeConfig.height},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;i>0&&o>0&&s.ellipse(0,0,i,o),e.iconStyleConfig.isFilled?s.fillAndStroke():s.stroke()}paintClockIcon(e){const t=this.newBpmnCanvas(e,{height:152,width:152});t.begin(),t.moveTo(184,60),t.curveTo(188.4,60,192,56.4,192,52),t.lineTo(192,48),t.curveTo(192,40,188.4,40,184,40),t.curveTo(179.6,40,176,43.6,176,48),t.lineTo(176,52),t.curveTo(176,56.4,179.6,60,184,60),t.close(),t.moveTo(184,308),t.curveTo(179.6,308,176,311.6,176,316),t.lineTo(176,320),t.curveTo(176,324.4,179.6,328,184,328),t.curveTo(188.4,328,192,324.4,192,320),t.lineTo(192,316),t.curveTo(192,311.6,188.4,308,184,308),t.close(),t.moveTo(52,176),t.lineTo(48,176),t.curveTo(43.6,176,40,179.6,40,184),t.curveTo(40,188.4,43.6,192,48,192),t.lineTo(52,192),t.curveTo(56.4,192,69,188.4,60,184),t.curveTo(60,179.6,56.4,176,52,176),t.close(),t.moveTo(320,176),t.lineTo(316,176),t.curveTo(311.6,176,308,179.6,308,184),t.curveTo(308,188.4,311.6,192,316,192),t.lineTo(320,192),t.curveTo(324.4,192,328,188.4,328,184),t.curveTo(328,179.6,324.4,176,320,176),t.moveTo(93.6,82.4),t.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),t.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),t.lineTo(85.2,96.4),t.curveTo(86.8,98,88.8,98.8,90.8,98.8),t.curveTo(92.8,98.8,94.4,98,96.4,96.4),t.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),t.lineTo(93.6,82.4),t.moveTo(85.2,271.6),t.lineTo(82.4,274.4),t.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),t.curveTo(84,287.2,86,288,88,288),t.curveTo(90,288,92,287.2,93.6,285.6),t.lineTo(96.4,282.8),t.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),t.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),t.moveTo(274.4,82.4),t.lineTo(271.6,85.2),t.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),t.curveTo(273.298,98,275.2,98.8,277.2,98.8),t.curveTo(279.2,98.8,281.2,98,282.8,96.4),t.lineTo(285.6,93.6),t.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),t.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),t.moveTo(192,180.8),t.lineTo(192,108),t.curveTo(192,103.6,188.4,100,184,100),t.curveTo(179.6,100,176,103.6,176,108),t.lineTo(176,184),t.curveTo(176,186,176.8,188,178.4,189.6),t.lineTo(266,277.2),t.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),t.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),t.curveTo(280.4,274,280.4,269.2,277.2,266),t.lineTo(192,180.8),t.moveTo(184,0),t.curveTo(82.4,0,0,82.4,0,184),t.curveTo(0,285.6,82.4,368,184,368),t.curveTo(285.6,368,368,285.6,368,184),t.curveTo(368,82.4,285.6,0,184,0),t.moveTo(184,352),t.curveTo(91.2,352,16,276.8,16,184),t.curveTo(16,91.2,91.2,16,184,16),t.curveTo(276.8,16,352,91.2,352,184),t.curveTo(352,276.8,276.8,352,184,352),t.fillAndStroke()}paintTriangleIcon(e){const t=this.newBpmnCanvas(e,{height:735,width:849});t.begin(),t.moveTo(497,55),t.lineTo(817,609),t.curveTo(849,665,808,735,744,735),t.lineTo(105,735),t.curveTo(40,735,0,665,32,609),t.lineTo(352,55),t.curveTo(384,0,465,0,497,55),t.close(),t.fillAndStroke()}paintUpArrowheadIcon(e){const t=this.newBpmnCanvas(e,{height:50,width:40});t.begin(),t.moveTo(0,49.5),t.lineTo(19.5,1),t.curveTo(19.75,.25,20,0,20.25,.25),t.lineTo(40,49.5),t.curveTo(40,49.5,39.75,50,39.6,49.75),t.lineTo(20,30),t.lineTo(.4,49.75),t.curveTo(.4,49.75,.25,50,0,49.5),t.close(),t.fillAndStroke()}paintDoubleLeftArrowheadsIcon(e){const t=this.newBpmnCanvas(e,{height:53.5,width:105});t.begin(),t.moveTo(91.4,0),t.curveTo(91.4,0,91.2,0,91,.2),t.lineTo(50,25),t.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),t.lineTo(46.4,0),t.curveTo(46.4,0,46.2,0,46,.2),t.lineTo(4.9,25),t.curveTo(2,26.2,0,27.3,4.9,28.5),t.lineTo(45.8,53),t.curveTo(46,53.3,46.2,53.5,46.4,53.5),t.lineTo(46.4,27),t.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),t.lineTo(90.8,53.3),t.curveTo(91,53.3,91.2,53.5,91.4,53.5),t.lineTo(91.4,0),t.close(),t.fillAndStroke()}drawCrossIcon(e){const t=this.newBpmnCanvas(e,{height:1,width:1});return t.begin(),t.moveTo(.38,0),t.lineTo(.62,0),t.lineTo(.62,.38),t.lineTo(1,.38),t.lineTo(1,.62),t.lineTo(.62,.62),t.lineTo(.62,1),t.lineTo(.38,1),t.lineTo(.38,.62),t.lineTo(0,.62),t.lineTo(0,.38),t.lineTo(.38,.38),t.close(),t}paintListIcon(e){const t=this.newBpmnCanvas(e,{height:60,width:60});t.begin(),t.moveTo(0,0),t.lineTo(60,0),t.lineTo(60,60),t.lineTo(0,60),t.lineTo(0,0),t.close(),t.moveTo(5,5),t.lineTo(55,5),t.close(),t.moveTo(5,21.6),t.lineTo(55,21.6),t.close(),t.moveTo(5,38.3),t.lineTo(55,38.3),t.close(),t.moveTo(5,55),t.lineTo(55,55),t.close(),t.fillAndStroke()}paintXCrossIcon(e){const t=this.drawCrossIcon(e);t.rotateOnIconCenter(45),t.fillAndStroke()}paintPlusCrossIcon(e){this.drawCrossIcon(e).fillAndStroke()}paintAsteriskIcon(e){const t=this.newBpmnCanvas(e,{height:1,width:1});be(e,t),t.fillAndStroke(),be(e,t),t.rotateOnIconCenter(60),t.fillAndStroke(),be(e,t),t.rotateOnIconCenter(240),t.fillAndStroke()}paintPersonIcon(e){const t=this.newBpmnCanvas({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0}},{height:239.68,width:143.61});t.begin(),t.moveTo(124.31,150.29),t.lineTo(99.66,141.03),t.arcTo(6.43,6.43,0,0,1,95.51,135.03),t.lineTo(95.51,130.66),t.arcTo(47.75,47.75,0,0,0,119.51,89.25),t.lineTo(119.51,71.25),t.arcTo(47.62,47.62,0,0,0,101.18,33.64),t.arcTo(29.35,29.35,0,0,0,101.52,29.14),t.arcTo(29.68,29.68,0,0,0,42.17,29.14),t.arcTo(29.24,29.24,0,0,0,42.53,33.63),t.arcTo(47.65,47.65,0,0,0,24.14,71.23),t.lineTo(24.14,89.23),t.arcTo(47.7,47.7,0,0,0,48.19,130.63),t.lineTo(48.19,135.03),t.arcTo(6.43,6.43,0,0,1,44.03,141.03),t.lineTo(19.31,150.29),t.arcTo(29.81,29.81,0,0,0,.09,178.03),t.lineTo(.09,233.51),t.arcTo(5.63,5.63,0,1,0,11.34,233.51),t.lineTo(11.34,178.03),t.arcTo(18.19,18.19,0,0,1,11.57,175.17),t.lineTo(20.5,184.11),t.arcTo(12.32,12.32,0,0,1,24.14,192.89),t.lineTo(24.14,233.51),t.arcTo(5.63,5.63,0,1,0,35.39,233.51),t.lineTo(35.39,192.93),t.arcTo(23.5,23.5,0,0,0,28.46,176.2),t.lineTo(17.04,164.78),t.arcTo(18.34,18.34,0,0,1,23.29,160.78),t.lineTo(43.65,153.15),t.lineTo(66.22,175.72),t.lineTo(66.22,233.51),t.arcTo(5.63,5.63,0,1,0,77.47,233.51),t.lineTo(77.47,175.76),t.lineTo(100.04,153.19),t.lineTo(120.4,160.82),t.arcTo(18.39,18.39,0,0,1,126.65,164.82),t.lineTo(115.24,176.24),t.arcTo(23.5,23.5,0,0,0,108.31,192.93),t.lineTo(108.31,233.55),t.arcTo(5.63,5.63,0,1,0,119.56,233.55),t.lineTo(119.56,192.93),t.arcTo(12.35,12.35,0,0,1,123.19,184.15),t.lineTo(132.13,175.22),t.arcTo(18,18,0,0,1,132.36,178.08),t.lineTo(132.36,233.56),t.arcTo(5.63,5.63,0,0,0,143.61,233.56),t.lineTo(143.61,178.03),t.arcTo(29.81,29.81,0,0,0,124.31,150.29),t.close(),t.moveTo(71.85,10.72),t.arcTo(18.46,18.46,0,0,1,90.17,27.18),t.arcTo(47.68,47.68,0,0,0,53.53,27.18),t.arcTo(18.44,18.44,0,0,1,71.85,10.72),t.close(),t.moveTo(35.39,71.23),t.arcTo(36.46,36.46,0,0,1,108.31,71.23),t.lineTo(108.31,77.4),t.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),t.arcTo(5.62,5.62,0,0,0,48.78,62.71),t.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),t.close(),t.moveTo(35.39,89.23),t.lineTo(35.39,87.08),t.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),t.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),t.lineTo(108.31,89.24),t.arcTo(36.46,36.46,0,1,1,35.39,89.24),t.close(),t.moveTo(71.85,165.45),t.lineTo(54.06,147.69),t.arcTo(17.7,17.7,0,0,0,59.43,135.32),t.arcTo(47.57,47.57,0,0,0,84.27,135.32),t.arcTo(17.7,17.7,0,0,0,89.64,147.69),t.close(),t.fill()}paintGearIcon(e){const t=this.newBpmnCanvas(e,{height:100,width:100});$.paintGearIconBackground(t),t.translateIconOrigin(14,14),$.paintGearIconForeground(t)}static paintGearIconBackground(e){e.begin(),e.moveTo(2.06,24.62),e.lineTo(10.17,30.95),e.lineTo(9.29,37.73),e.lineTo(0,41.42),e.lineTo(2.95,54.24),e.lineTo(13.41,52.92),e.lineTo(17.39,58.52),e.lineTo(13.56,67.66),e.lineTo(24.47,74.44),e.lineTo(30.81,66.33),e.lineTo(37.88,67.21),e.lineTo(41.57,76.5),e.lineTo(54.24,73.55),e.lineTo(53.06,62.94),e.lineTo(58.52,58.52),e.lineTo(67.21,63.09),e.lineTo(74.58,51.88),e.lineTo(66.03,45.25),e.lineTo(66.92,38.62),e.lineTo(76.5,34.93),e.lineTo(73.7,22.26),e.lineTo(62.64,23.44),e.lineTo(58.81,18.42),e.lineTo(62.79,8.7),e.lineTo(51.74,2.21),e.lineTo(44.81,10.47),e.lineTo(38.03,9.43),e.lineTo(33.75,0),e.lineTo(21.52,3.24),e.lineTo(22.7,13.56),e.lineTo(18.13,17.54),e.lineTo(8.7,13.56),e.close();const t=24.8,s=39;$.paintGearInnerCircle(e,t,s)}static paintGearIconForeground(e){e.begin(),e.moveTo(16.46,41.42),e.lineTo(24.57,47.75),e.lineTo(23.69,54.53),e.lineTo(14.4,58.22),e.lineTo(17.35,71.04),e.lineTo(27.81,69.72),e.lineTo(31.79,75.32),e.lineTo(27.96,84.46),e.lineTo(38.87,91.24),e.lineTo(45.21,83.13),e.lineTo(52.28,84.01),e.lineTo(55.97,93.3),e.lineTo(68.64,90.35),e.lineTo(67.46,79.74),e.lineTo(72.92,75.32),e.lineTo(81.61,79.89),e.lineTo(88.98,68.68),e.lineTo(80.43,62.05),e.lineTo(81.32,55.42),e.lineTo(90.9,51.73),e.lineTo(88.1,39.06),e.lineTo(77.04,40.24),e.lineTo(73.21,35.22),e.lineTo(77.19,25.5),e.lineTo(66.14,19.01),e.lineTo(59.21,27.27),e.lineTo(52.43,26.23),e.lineTo(48.15,16.8),e.lineTo(35.92,20.04),e.lineTo(37.1,30.36),e.lineTo(32.53,34.34),e.lineTo(23.1,30.36),e.close();const t=39.2,s=55.8;$.paintGearInnerCircle(e,t,s),e.begin(),$.paintGearInnerCircle(e,t,s)}static paintGearInnerCircle(e,t,s){e.moveTo(t,s),e.arcTo(13.5,13.5,0,1,1,t+2*13.5,s),e.arcTo(13.5,13.5,0,0,1,t,s),e.close(),e.fillAndStroke()}paintExpandIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;s.roundrect(0,0,i,o,2,2),s.stroke(),s.begin(),s.moveTo(i/2,o/4),s.lineTo(i/2,o*3/4),s.close(),s.moveTo(i/4,o/2),s.lineTo(i*3/4,o/2),s.close(),s.fillAndStroke()}paintLoopIcon(e){const{iconStyleConfig:t}=e;t.fillColor=t.strokeColor;const s=this.newBpmnCanvas(e,{width:22.49,height:21.62});s.begin(),s.moveTo(5.5,19.08),s.arcTo(8,8,0,1,1,10.5,21.08),s.stroke(),s.begin(),s.moveTo(7.5,14.08),s.lineTo(5.75,19.08),s.lineTo(0,17.08),s.close(),s.fillAndStroke()}paintSequentialMultiInstanceIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),{canvas:i,iconStyleConfig:o}=e;i.setFillColor(o.strokeColor);const r=t.width,l=t.height/5;s.rect(0,0,r,l),s.fill(),s.rect(0,2*l,r,l),s.fill(),s.rect(0,4*l,r,l),s.fill()}paintParallelMultiInstanceIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),{canvas:i,iconStyleConfig:o}=e;i.setFillColor(o.strokeColor);const r=t.width/5,l=t.height;s.begin(),s.rect(0,0,r,l),s.fill(),s.rect(2*r,0,r,l),s.fill(),s.rect(4*r,0,r,l),s.fill()}paintRightArrowIcon(e){const t=this.newBpmnCanvas(e,{width:512,height:415.23});t.setRoundLineJoin(),t.begin(),t.moveTo(512,207.61),t.lineTo(304.38,0),t.lineTo(304.38,135.39),t.lineTo(0,135.39),t.lineTo(0,279.84),t.lineTo(304.38,279.84),t.lineTo(304.38,415.23),t.lineTo(512,207.61),t.close(),t.fillAndStroke()}paintErrorIcon(e){const t=this.newBpmnCanvas(e,{width:72.44,height:71.82});t.begin(),t.moveTo(0,53.32),t.lineTo(19.48,0),t.lineTo(19.48,0),t.lineTo(50.85,40.07),t.lineTo(72.44,18.21),t.lineTo(53.12,71.82),t.lineTo(22.5,31.37),t.close(),t.fillAndStroke()}paintHandIcon(e){const t=this.newBpmnCanvas(e,{width:343.65,height:354.12});t.begin(),t.moveTo(231.66,336.39),t.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),t.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),t.lineTo(146.33,248.39),t.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),t.curveTo(275.75,283.38,297.25,288,301.42,267.77),t.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),t.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),t.lineTo(165.2,194.8),t.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),t.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),t.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),t.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),t.lineTo(169.35,138.97),t.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),t.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),t.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),t.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),t.lineTo(127.61,81.87),t.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),t.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),t.curveTo(143.83,0,124.08,14.49,124.08,14.49),t.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),t.lineTo(0,251.94),t.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),t.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),t.fillAndStroke()}paintScriptIcon(e){e.iconStyleConfig.fillColor=e.iconStyleConfig.strokeColor;const t=this.newBpmnCanvas(e,{width:458.75,height:461.64});t.begin(),t.moveTo(67.85,.57),t.curveTo(50.73,0,33.26,8.86,22.35,18.84),t.curveTo(8.11,32.15,0,50.77,0,70.26),t.curveTo(0,73.15,0,87.59,0,113.6),t.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),t.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),t.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),t.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),t.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),t.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),t.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),t.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),t.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),t.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),t.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),t.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),t.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),t.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),t.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),t.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),t.curveTo(389.09,14.11,366.95,.59,341.75,.59),t.curveTo(286.97,.59,122.63,.57,67.85,.57),t.close(),t.moveTo(85.04,72.68),t.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),t.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),t.curveTo(55.8,44.28,59.84,41,73.82,41),t.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),t.close(),t.moveTo(364.94,52.9),t.curveTo(370,61.11,373.9,76.44,377.38,93.51),t.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),t.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),t.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),t.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),t.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),t.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),t.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),t.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),t.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),t.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),t.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),t.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),t.close(),t.moveTo(409.96,399.48),t.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),t.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),t.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),t.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),t.close(),t.fill(),t.begin(),t.moveTo(182.1,131.2),t.lineTo(182.1,151.68),t.lineTo(321.89,151.68),t.lineTo(321.89,131.2),t.lineTo(182.1,131.2),t.close(),t.moveTo(162.25,251.09),t.lineTo(162.25,271.49),t.lineTo(301.96,271.49),t.lineTo(301.96,251.09),t.lineTo(162.25,251.09),t.close(),t.fill()}paintTableIcon(e){const t=this.newBpmnCanvas(e,{width:640,height:640});t.begin(),t.moveTo(.19,.1),t.lineTo(298.78,.1),t.lineTo(298.78,198.88),t.lineTo(.19,198.88),t.lineTo(.19,.1),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(0,0),t.lineTo(298.78,0),t.lineTo(298.78,48.88),t.lineTo(0,48.88),t.lineTo(0,0),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(0,48.88),t.lineTo(98.78,48.88),t.lineTo(98.78,198.88),t.lineTo(0,198.88),t.lineTo(0,48.88),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(1.09,122.69),t.lineTo(298.78,122.69),t.close(),t.fillAndStroke(),t.setFillColor(e.iconStyleConfig.strokeColor),t.begin(),t.moveTo(0,0),t.lineTo(298.78,0),t.lineTo(298.78,48.88),t.lineTo(0,48.88),t.lineTo(0,0),t.close(),t.fillAndStroke()}paintPentagon(e){const t=this.newBpmnCanvas(e,{width:16,height:16});t.begin(),t.moveTo(16,6.5),t.lineTo(8,0),t.lineTo(0,6.5),t.lineTo(3,16),t.lineTo(13,16),t.lineTo(16,6.5),t.lineTo(8,0),t.stroke()}}function be(n,e){e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,1),e.lineTo(.38,1),e.close()}class se{static get(){return this.instance}static set(e){this.instance=e}}g(se,"instance",new $);const hs=[w.LOOP,w.MULTI_INSTANCE_PARALLEL,w.MULTI_INSTANCE_SEQUENTIAL,w.COMPENSATION,w.EXPAND,w.ADHOC];function fs(n){const e=hs.filter(t=>n.includes(t));for(const t of n.filter(s=>!e.includes(s)))e.push(t);return e}function Mt(n,e){se.get().paintEnvelopeIcon({...n,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:{...n.iconStyleConfig,isFilled:e}})}class Xe extends Ke{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter",se.get())}paintForeground(t,s,i,o,r){super.paintForeground(t,s,i,o,r),this.paintMarkerIcons(ne({canvas:t,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(t){const s=O.getValue(this.style,m.MARKERS,void 0);if(s){const i=fs(s.split(","));for(const[o,r]of i.entries()){switch(t={...t,setIconOriginFunct:this.getMarkerIconOriginFunction(i.length,o+1)},t.canvas.save(),r){case w.LOOP:{this.iconPainter.paintLoopIcon(t);break}case w.MULTI_INSTANCE_SEQUENTIAL:{this.iconPainter.paintSequentialMultiInstanceIcon(t);break}case w.MULTI_INSTANCE_PARALLEL:{this.iconPainter.paintParallelMultiInstanceIcon(t);break}case w.EXPAND:{this.iconPainter.paintExpandIcon(t);break}}t.canvas.restore()}}}getMarkerIconOriginFunction(t,s){return t===1?i=>i.setIconOriginForIconBottomCentered():i=>{i.setIconOriginForIconBottomCentered();const o=Math.pow(-1,s)*(p.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+p.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);i.translateIconOrigin(o,0)}}}class z extends Xe{paintForeground(e,t,s,i,o){super.paintForeground(e,t,s,i,o),this.paintTaskIcon(ne({canvas:e,x:t,y:s,width:i,height:o,shape:this}))}}class gs extends z{paintTaskIcon(e){this.iconPainter.paintEmptyIcon()}}class Ts extends z{paintTaskIcon(e){this.iconPainter.paintGearIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class ps extends z{paintTaskIcon(e){this.iconPainter.paintPersonIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class Es extends z{paintTaskIcon(e){if(!bt(this.style)){Mt(e,!1);return}const t=4,s=4,i={...e.shapeConfig,width:20,height:20};this.iconPainter.paintCircleIcon({canvas:e.canvas,shapeConfig:i,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1},ratioFromParent:void 0,setIconOriginFunct:o=>o.setIconOriginToShapeTopLeft(s,t)}),i.x+=t,i.y+=s,this.iconPainter.paintEnvelopeIcon({...e,shapeConfig:i,ratioFromParent:.65,setIconOriginFunct:o=>o.setIconOriginForIconCentered()})}}class Ss extends z{paintTaskIcon(e){Mt(e,!0)}}class Is extends z{paintTaskIcon(e){this.iconPainter.paintHandIcon({...e,ratioFromParent:.18,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class ms extends z{paintTaskIcon(e){this.iconPainter.paintScriptIcon({...e,ratioFromParent:.22,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class Cs extends Xe{paintForeground(e,t,s,i,o){super.paintForeground(e,t,s,i,o);const r=ne({canvas:e,x:t,y:s,width:i,height:o,shape:this});switch(O.getValue(this.style,m.GLOBAL_TASK_KIND,void 0)){case h.GLOBAL_TASK_MANUAL:{this.iconPainter.paintHandIcon({...r,ratioFromParent:.18,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case h.GLOBAL_TASK_SCRIPT:{this.iconPainter.paintScriptIcon({...r,ratioFromParent:.22,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case h.GLOBAL_TASK_USER:{this.iconPainter.paintPersonIcon({...r,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break}case h.GLOBAL_TASK_BUSINESS_RULE:{this.iconPainter.paintTableIcon({...r,ratioFromParent:.6,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(15)});break}default:this.iconPainter.paintEmptyIcon()}}}class As extends Xe{paintBackground(e,t,s,i,o){const r=O.getValue(this.style,m.SUB_PROCESS_KIND,void 0);if(e.save(),r===D.EVENT&&(e.setDashed(!0,!1),e.setDashPattern("1 2")),super.paintBackground(e,t,s,i,o),r===D.TRANSACTION){const l=p.SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET,a=p.SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE;e.roundrect(t+l,s+l,i-2*l,o-2*l,a,a),e.stroke()}e.restore()}}class Os extends z{paintTaskIcon(e){this.iconPainter.paintTableIcon({...e,ratioFromParent:.6,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(15)})}}class Ns extends L.mxConnector{paintEdgeShape(e,t){const s=this.createMarker(e,t,!0),i=this.createMarker(e,t,!1);this.paintEdgeLine(e,t),e.setShadow(!1),e.setDashed(!1,!1),s!=null&&(e.setFillColor(O.getValue(this.style,m.EDGE_START_FILL_COLOR,this.stroke)),s()),i!=null&&(e.setFillColor(O.getValue(this.style,m.EDGE_END_FILL_COLOR,this.stroke)),i())}paintEdgeLine(e,t){const s=vs(e);ht(e,"stroke"),this.paintLine(e,t,this.isRounded),ht(e,s)}}function vs(n){return n instanceof he?n.pointerEventsValue:null}function ht(n,e){n instanceof he&&(n.pointerEventsValue=e)}class ee extends L.mxEllipse{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter",se.get());g(this,"iconPainters",new Map([[R.MESSAGE,t=>this.iconPainter.paintEnvelopeIcon({...t,ratioFromParent:.5})],[R.TERMINATE,t=>this.iconPainter.paintCircleIcon({...t,ratioFromParent:.6})],[R.TIMER,t=>this.iconPainter.paintClockIcon({...t,setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(5)})],[R.SIGNAL,t=>this.iconPainter.paintTriangleIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:p.STROKE_WIDTH_THIN.valueOf()},setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(4)})],[R.LINK,t=>this.iconPainter.paintRightArrowIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[R.ERROR,t=>this.iconPainter.paintErrorIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[R.COMPENSATION,t=>this.iconPainter.paintDoubleLeftArrowheadsIcon({...t,ratioFromParent:.7,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[R.CANCEL,t=>this.iconPainter.paintXCrossIcon({...t,ratioFromParent:.78})],[R.ESCALATION,t=>this.iconPainter.paintUpArrowheadIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:p.STROKE_WIDTH_THIN.valueOf()}})],[R.CONDITIONAL,t=>this.iconPainter.paintListIcon({...t,ratioFromParent:.6,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})]]));g(this,"withFilledIcon",!1)}paintVertexShape(t,s,i,o,r){const l=ne({canvas:t,x:s,y:i,width:o,height:r,shape:this,isFilled:this.withFilledIcon});ee.setDashedOuterShapePattern(l,O.getValue(this.style,m.IS_INTERRUPTING,void 0)),this.paintOuterShape(l),ee.restoreOriginalOuterShapePattern(l),this.paintInnerShape(l)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(t,s,i,o,r)}paintInnerShape(t){(this.iconPainters.get(O.getValue(this.style,m.EVENT_DEFINITION_KIND,R.NONE))??(()=>this.iconPainter.paintEmptyIcon()))(t)}static setDashedOuterShapePattern(t,s){t.canvas.save(),s==="false"&&(t.canvas.setDashed(!0,!1),t.canvas.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(t){t.canvas.restore()}}class Ls extends ee{constructor(){super(),this.withFilledIcon=!0}}class Ue extends ee{paintOuterShape({canvas:e,shapeConfig:{x:t,y:s,width:i,height:o,strokeWidth:r}}){e.ellipse(t,s,i,o),e.fillAndStroke();const l=r*1.5;e.ellipse(i*.02+l+t,o*.02+l+s,i*.96-2*l,o*.96-2*l),e.stroke()}}class ys extends Ue{constructor(){super(),this.withFilledIcon=!0}}class _s extends Ke{constructor(){super(...arguments);g(this,"iconPainter",se.get())}paintVertexShape(t,s,i,o,r){const l=ne({canvas:t,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:1,isFilled:O.getValue(this.style,m.IS_INITIATING,"true")=="false"});this.iconPainter.paintEnvelopeIcon(l)}}class Te extends L.mxRhombus{constructor(){super(...arguments);g(this,"iconPainter",se.get())}paintVertexShape(t,s,i,o,r){const l=ne({canvas:t,x:s,y:i,width:o,height:r,shape:this});this.paintOuterShape(l),this.paintInnerShape(l)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(t,s,i,o,r)}}class ws extends Te{paintInnerShape(e){this.iconPainter.paintXCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Rs extends Te{paintInnerShape(e){this.iconPainter.paintPlusCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class bs extends Te{paintInnerShape(e){this.iconPainter.paintCircleIcon({...e,ratioFromParent:.62,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1,strokeWidth:p.STROKE_WIDTH_THICK.valueOf()}})}}class Fs extends Te{paintInnerShape(e){this.iconPainter.paintAsteriskIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Ps extends Te{paintInnerShape(e){e={...e,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1}},this.iconPainter.paintCircleIcon({...e,ratioFromParent:.55}),bt(this.style)||this.iconPainter.paintCircleIcon({...e,ratioFromParent:.45});const t={...e,ratioFromParent:.3};O.getValue(this.style,m.EVENT_BASED_GATEWAY_KIND,de.Exclusive)==de.Parallel?this.iconPainter.paintPlusCrossIcon(t):this.iconPainter.paintPentagon(t)}}class ks extends Ke{paintForeground(e,t,s,i,o){e.begin(),e.moveTo(t+p.TEXT_ANNOTATION_BORDER_LENGTH,s),e.lineTo(t,s),e.lineTo(t,s+o),e.lineTo(t+p.TEXT_ANNOTATION_BORDER_LENGTH,s+o),e.stroke()}paintBackground(e,t,s,i,o){e.save(),e.setStrokeColor("none"),super.paintBackground(e,t,s,i,o),e.restore()}}class xs{configureShapes(){this.initMxSvgCanvasPrototype(),this.initMxShapePrototype(),this.registerShapes()}registerShapes(){v.registerShape(h.EVENT_END,Ls),v.registerShape(h.EVENT_START,ee),v.registerShape(h.EVENT_INTERMEDIATE_THROW,ys),v.registerShape(h.EVENT_INTERMEDIATE_CATCH,Ue),v.registerShape(h.EVENT_BOUNDARY,Ue),v.registerShape(h.GATEWAY_COMPLEX,Fs),v.registerShape(h.GATEWAY_EVENT_BASED,Ps),v.registerShape(h.GATEWAY_EXCLUSIVE,ws),v.registerShape(h.GATEWAY_INCLUSIVE,bs),v.registerShape(h.GATEWAY_PARALLEL,Rs),v.registerShape(h.SUB_PROCESS,As),v.registerShape(h.CALL_ACTIVITY,Cs),v.registerShape(h.TASK,gs),v.registerShape(h.TASK_SERVICE,Ts),v.registerShape(h.TASK_USER,ps),v.registerShape(h.TASK_RECEIVE,Es),v.registerShape(h.TASK_SEND,Ss),v.registerShape(h.TASK_MANUAL,Is),v.registerShape(h.TASK_SCRIPT,ms),v.registerShape(h.TASK_BUSINESS_RULE,Os),v.registerShape(h.TEXT_ANNOTATION,ks),v.registerShape(m.EDGE,Ns),v.registerShape(m.MESSAGE_FLOW_ICON,_s)}initMxSvgCanvasPrototype(){he.prototype.getTextCss=function(){const e=this.state,t=c.ABSOLUTE_LINE_HEIGHT?e.fontSize*c.LINE_HEIGHT+"px":c.LINE_HEIGHT*this.lineHeightCorrection;let s="display: inline-block; font-size: "+e.fontSize+"px; font-family: "+e.fontFamily+"; color: "+e.fontColor+"; line-height: "+t+"; pointer-events: none; ";(e.fontStyle&c.FONT_BOLD)==c.FONT_BOLD&&(s+="font-weight: bold; "),(e.fontStyle&c.FONT_ITALIC)==c.FONT_ITALIC&&(s+="font-style: italic; ");const i=[];return(e.fontStyle&c.FONT_UNDERLINE)==c.FONT_UNDERLINE&&i.push("underline"),(e.fontStyle&c.FONT_STRIKETHROUGH)==c.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(s+="text-decoration: "+i.join(" ")+"; "),s}}initMxShapePrototype(){L.mxShape.prototype.createSvgCanvas=function(){var s;const e=new he(this.node,!1);e.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,e.pointerEventsValue=this.svgPointerEvents;const t=this.getSvgScreenOffset();if(t==0?this.node.removeAttribute("transform"):this.node.setAttribute("transform","translate("+t+","+t+")"),(s=this.state)!=null&&s.cell){const i=this.state.cell,o=as(i,this.dialect===c.DIALECT_STRICTHTML),r=this.state.style[m.EXTRA_CSS_CLASSES];typeof r=="string"&&o.push(...r.split(",")),this.node.setAttribute("class",o.join(" ")),this.node.dataset.bpmnId=this.state.cell.id}return e.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(e.format=function(i){return Math.round(parseFloat(i))}),e}}}const ft=12;class Bt{constructor(e){g(this,"specificFlowStyles",new Fe([[M.SEQUENCE_FLOW,e=>{e[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN}],[M.MESSAGE_FLOW,e=>{e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="8 5",e[c.STYLE_STARTARROW]=c.ARROW_OVAL,e[c.STYLE_STARTSIZE]=8,e[c.STYLE_STARTFILL]=!0,e[m.EDGE_START_FILL_COLOR]=p.MESSAGE_FLOW_MARKER_START_FILL_COLOR,e[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN,e[c.STYLE_ENDFILL]=!0,e[m.EDGE_END_FILL_COLOR]=p.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[M.ASSOCIATION_FLOW,e=>{e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="1 2",e[c.STYLE_STARTSIZE]=ft}]]));g(this,"specificSequenceFlowStyles",new Fe([[V.DEFAULT,e=>{e[c.STYLE_STARTARROW]=Rt.ARROW_DASH}],[V.CONDITIONAL_FROM_ACTIVITY,e=>{e[c.STYLE_STARTARROW]=c.ARROW_DIAMOND_THIN,e[c.STYLE_STARTSIZE]=18,e[c.STYLE_STARTFILL]=!0,e[m.EDGE_START_FILL_COLOR]=p.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]));g(this,"specificAssociationFlowStyles",new Fe([[q.NONE,e=>{}],[q.ONE,e=>{e[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}],[q.BOTH,e=>{e[c.STYLE_STARTARROW]=c.ARROW_OPEN_THIN,e[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}]]));this.graph=e}configureStyles(){this.configureDefaultVertexStyle(),this.configurePoolStyle(),this.configureLaneStyle(),this.configureTextAnnotationStyle(),this.configureGroupStyle(),this.configureActivityStyles(),this.configureEventStyles(),this.configureGatewayStyles(),this.configureDefaultEdgeStyle(),this.configureFlowStyles()}getStylesheet(){return this.graph.getStylesheet()}putCellStyle(e,t){this.getStylesheet().putCellStyle(e,t)}configureDefaultVertexStyle(){const e=this.getStylesheet().getDefaultVertexStyle();gt(e),e[c.STYLE_ABSOLUTE_ARCSIZE]=!0,e[c.STYLE_ARCSIZE]=p.SHAPE_ARC_SIZE}configurePoolStyle(){const e={};e[c.STYLE_SHAPE]=c.SHAPE_SWIMLANE,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_STARTSIZE]=p.POOL_LABEL_SIZE,e[c.STYLE_FILLCOLOR]=p.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.POOL,e)}configureLaneStyle(){const e={};e[c.STYLE_SHAPE]=c.SHAPE_SWIMLANE,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_SWIMLANE_LINE]=0,e[c.STYLE_STARTSIZE]=p.LANE_LABEL_SIZE,e[c.STYLE_FILLCOLOR]=p.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.LANE,e)}configureEventStyles(){for(const e of I.eventKinds()){const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_PERIMETER]=rt.EllipsePerimeter,t[c.STYLE_STROKEWIDTH]=e==h.EVENT_END?p.STROKE_WIDTH_THICK:p.STROKE_WIDTH_THIN,t[c.STYLE_VERTICAL_LABEL_POSITION]=c.ALIGN_BOTTOM,this.putCellStyle(e,t)}}configureTextAnnotationStyle(){const e={};e[c.STYLE_SHAPE]=h.TEXT_ANNOTATION,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_ALIGN]=c.ALIGN_LEFT,e[c.STYLE_SPACING_LEFT]=5,e[c.STYLE_FILLCOLOR]=p.TEXT_ANNOTATION_FILL_COLOR,e[c.STYLE_STROKEWIDTH]=p.STROKE_WIDTH_THIN,this.putCellStyle(h.TEXT_ANNOTATION,e)}configureGroupStyle(){const e={};e[c.STYLE_ROUNDED]=!0,e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="7 4 1 4",e[c.STYLE_STROKEWIDTH]=p.STROKE_WIDTH_THIN,e[c.STYLE_FILLCOLOR]=p.GROUP_FILL_COLOR,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_TOP,this.putCellStyle(h.GROUP,e)}configureActivityStyles(){for(const e of I.activityKinds()){const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_ROUNDED]=!0,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,t[c.STYLE_STROKEWIDTH]=e==h.CALL_ACTIVITY?p.STROKE_WIDTH_THICK:p.STROKE_WIDTH_THIN,this.putCellStyle(e,t)}}configureGatewayStyles(){for(const e of I.gatewayKinds()){const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_PERIMETER]=rt.RhombusPerimeter,t[c.STYLE_STROKEWIDTH]=p.STROKE_WIDTH_THIN,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_TOP,t[c.STYLE_LABEL_POSITION]=c.ALIGN_LEFT,t[c.STYLE_VERTICAL_LABEL_POSITION]=c.ALIGN_TOP,this.putCellStyle(e,t)}}configureDefaultEdgeStyle(){const e=this.getStylesheet().getDefaultEdgeStyle();gt(e),e[c.STYLE_SHAPE]=m.EDGE,e[c.STYLE_ENDSIZE]=ft,e[c.STYLE_STROKEWIDTH]=1.5,e[c.STYLE_ROUNDED]=!0,e[c.STYLE_ARCSIZE]=5,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_BOTTOM,delete e[c.STYLE_ENDARROW]}configureEdgeStyles(e,t){for(const s of e){const i={};t.get(s)(i),this.graph.getStylesheet().putCellStyle(s.toString(),i)}}configureFlowStyles(){this.configureEdgeStyles(Object.values(M),this.specificFlowStyles),this.configureEdgeStyles(Object.values(V),this.specificSequenceFlowStyles),this.configureEdgeStyles(Object.values(q),this.specificAssociationFlowStyles)}}function gt(n){n[c.STYLE_FONTFAMILY]=p.DEFAULT_FONT_FAMILY,n[c.STYLE_FONTSIZE]=p.DEFAULT_FONT_SIZE,n[c.STYLE_FONTCOLOR]=p.DEFAULT_FONT_COLOR,n[c.STYLE_FILLCOLOR]=p.DEFAULT_FILL_COLOR,n[c.STYLE_STROKECOLOR]=p.DEFAULT_STROKE_COLOR,n[c.STYLE_LABEL_BACKGROUNDCOLOR]=c.NONE,n[c.STYLE_WHITE_SPACE]="wrap"}class Fe extends Map{get(e){return super.get(e)??(()=>{})}}class Ms{constructor(e){g(this,"graph");this.container=e,this.graph=new is(e)}configure(e){return this.configureGraph(),this.configureNavigationSupport(e),new Bt(this.graph).configureStyles(),new xs().configureShapes(),new rs().configureMarkers(),this.graph}configureGraph(){this.graph.setCellsLocked(!0),this.graph.setCellsSelectable(!1),this.graph.setEdgeLabelsMovable(!1),this.graph.setHtmlLabels(!0),this.graph.setConstrainChildren(!1),this.graph.setExtendParents(!1),this.graph.foldingEnabled=!1}configureNavigationSupport(e){var s;const t=this.graph.panningHandler;(s=e==null?void 0:e.navigation)!=null&&s.enabled?(t.addListener(W.PAN_START,this.getPanningHandler("grab")),t.addListener(W.PAN_END,this.getPanningHandler("default")),t.usePopupTrigger=!1,t.isForcePanningEvent=i=>W.isLeftMouseButton(i.getEvent())||W.isMultiTouchEvent(i.getEvent()),this.graph.setPanning(!0),this.graph.registerMouseWheelZoomListeners(e.navigation.zoom)):(this.graph.setPanning(!1),t.setPinchEnabled(!1),t.isForcePanningEvent=i=>!1)}getPanningHandler(e){return()=>{this.graph.isEnabled()&&(this.container.style.cursor=e)}}}class Bs{constructor(e){this.graph=e}fit(e){this.graph.customFit(e)}zoom(e){e=="in"?this.graph.zoomIn():this.graph.zoomOut()}}class Gs{constructor(e){this.convertedElements=e}deserialize(e){const t=C(e.category).flatMap(s=>C(s.categoryValue));for(const s of t)this.convertedElements.registerCategoryValue(s.id,s.value)}}class ie{}class Vs{warning(e){const t=e.getMessage();console.warn(`[bv-parser] ${t.template}`,...t.arguments)}}class Ys extends ie{constructor(e,t){super(),this.groupBpmnElementId=e,this.categoryValueReference=t}getMessage(){return{arguments:[this.categoryValueReference,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class Us extends ie{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class Ds extends ie{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class Ws extends ie{constructor(e,t){super(),this.shapeOrEdgeId=e,this.labelStyleId=t}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class Hs extends ie{constructor(e,t){super(),this.laneId=e,this.flowNodeReference=t}getMessage(){return{arguments:[this.flowNodeReference,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class Ks extends ie{constructor(e,t,s){super(),this.bpmnElementId=e,this.attachedToReference=t,this.attachedToKind=s}getMessage(){return{arguments:[this.bpmnElementId,this.attachedToReference,this.attachedToKind],template:"The boundary event %s must be attached to an activity, and not to %s of kind %s"}}}class zs{constructor(){g(this,"poolsById",new Map);g(this,"poolsByProcessRef",new Map);g(this,"messageFlows",new Map);g(this,"flowNodes",new Map);g(this,"lanes",new Map);g(this,"sequenceFlows",new Map);g(this,"associationFlows",new Map);g(this,"eventDefinitionsOfDefinitions",new Map);g(this,"globalTasks",new Map);g(this,"categoryValues",new Map)}getFlows(){return[...this.messageFlows.values(),...this.sequenceFlows.values(),...this.associationFlows.values()]}findPoolById(e){return this.poolsById.get(e)}findPoolByProcessRef(e){return this.poolsByProcessRef.get(e)}registerPool(e,t){this.poolsById.set(e.id,e),t&&this.poolsByProcessRef.set(t,e)}findMessageFlow(e){return this.messageFlows.get(e)}registerMessageFlow(e){this.messageFlows.set(e.id,e)}findFlowNode(e){return this.flowNodes.get(e)}registerFlowNode(e){this.flowNodes.set(e.id,e)}findLane(e){return this.lanes.get(e)}registerLane(e){this.lanes.set(e.id,e)}findSequenceFlow(e){return this.sequenceFlows.get(e)}registerSequenceFlow(e){this.sequenceFlows.set(e.id,e)}findAssociationFlow(e){return this.associationFlows.get(e)}registerAssociationFlow(e){this.associationFlows.set(e.id,e)}findEventDefinitionOfDefinition(e){return this.eventDefinitionsOfDefinitions.get(e)}registerEventDefinitionsOfDefinition(e,t){this.eventDefinitionsOfDefinitions.set(e,t)}findGlobalTask(e){return this.globalTasks.get(e)}registerGlobalTask(e,t){this.globalTasks.set(e,t)}findCategoryValue(e){return this.categoryValues.get(e)}registerCategoryValue(e,t){this.categoryValues.set(e,{value:t})}}const Gt=(n,e,t,s)=>{const i=n.findCategoryValue(t.categoryValueRef);if(i)return new Y(t.id,i.value,h.GROUP,s);e.warning(new Ys(t.id,t.categoryValueRef))};class Xs{constructor(e,t){this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){for(const t of C(e))this.parseCollaboration(t)}parseCollaboration(e){this.buildParticipant(e.participant),this.buildMessageFlows(e.messageFlow),this.buildGroups(e.group)}buildParticipant(e){for(const t of C(e))this.convertedElements.registerPool(new Y(t.id,t.name,h.POOL),t.processRef)}buildMessageFlows(e){for(const t of C(e))this.convertedElements.registerMessageFlow(new Nt(t.id,t.name,t.sourceRef,t.targetRef))}buildGroups(e){for(const t of C(e)){const s=Gt(this.convertedElements,this.parsingMessageCollector,t);s&&this.convertedElements.registerFlowNode(s)}}}class $s{constructor(e,t,s,i){this.x=e,this.y=t,this.width=s,this.height=i}}class Zs{constructor(e,t,s,i,o=ge.NONE){g(this,"extensions",{});this.id=e,this.bpmnElement=t,this.waypoints=s,this.label=i,this.messageVisibleKind=o}}class js{constructor(e,t){this.x=e,this.y=t}}class qs{constructor(e,t){g(this,"extensions",{});this.font=e,this.bounds=t}}class Qs{constructor(e,t,s,i,o,r){this.name=e,this.size=t,this.isBold=s,this.isItalic=i,this.isUnderline=o,this.isStrikeThrough=r}}class J{constructor(e,t){g(this,"convertedFonts",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){const t=[],s=[],i=[],o=[],r=C(e)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const l=r.BPMNPlane,a=this.deserializeEdges(l.BPMNEdge),u=this.deserializeShapes(l.BPMNShape);t.push(...u.flowNodes),s.push(...u.lanes),i.push(...u.pools),o.push(...a)}return{flowNodes:t,lanes:s,pools:i,edges:o}}deserializeFonts(e){this.convertedFonts=new Map;for(const t of C(e))for(const s of C(t.Font))this.convertedFonts.set(t.id,new Qs(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))}deserializeShapes(e){const t={flowNodes:[],lanes:[],pools:[]};for(const s of C(e))this.deserializeShapeAndStoreIfFound(s,t.flowNodes,i=>this.convertedElements.findFlowNode(i))||this.deserializeShapeAndStoreIfFound(s,t.lanes,i=>this.convertedElements.findLane(i))||this.deserializeShapeAndStoreIfFound(s,t.pools,i=>this.convertedElements.findPoolById(i))||this.parsingMessageCollector.warning(new Us(s.bpmnElement));return t}deserializeShapeAndStoreIfFound(e,t,s){const i=this.deserializeShape(e,s);return i?(t.push(i),!0):!1}deserializeShape(e,t){const s=t(e.bpmnElement);if(s){const i=J.deserializeBounds(e);(s instanceof fe||s instanceof j&&s.callActivityKind===ue.CALLING_PROCESS)&&!e.isExpanded&&s.markers.push(w.EXPAND);let o;I.isPoolOrLane(s.kind)&&(o=e.isHorizontal??!0);const r=e.BPMNLabel,l=this.deserializeLabel(r,e.id),a=new Ie(e.id,s,i,l,o);return J.setColorExtensionsOnShape(a,e),a}}static setColorExtensionsOnShape(e,t){"background-color"in t?e.extensions.fillColor=t["background-color"]:"fill"in t&&(e.extensions.fillColor=t.fill),"border-color"in t?e.extensions.strokeColor=t["border-color"]:"stroke"in t&&(e.extensions.strokeColor=t.stroke)}static deserializeBounds(e){const t=e.Bounds;if(t)return new $s(t.x,t.y,t.width,t.height)}deserializeEdges(e){return C(e).map(t=>{const s=this.convertedElements.findSequenceFlow(t.bpmnElement)||this.convertedElements.findMessageFlow(t.bpmnElement)||this.convertedElements.findAssociationFlow(t.bpmnElement);if(!s){this.parsingMessageCollector.warning(new Ds(t.bpmnElement));return}const i=this.deserializeWaypoints(t.waypoint),o=this.deserializeLabel(t.BPMNLabel,t.id),r=t.messageVisibleKind?t.messageVisibleKind:ge.NONE,l=new Zs(t.id,s,i,o,r);return J.setColorExtensionsOnEdge(l,t),l}).filter(Boolean)}static setColorExtensionsOnEdge(e,t){"border-color"in t?e.extensions.strokeColor=t["border-color"]:"stroke"in t&&(e.extensions.strokeColor=t.stroke)}deserializeWaypoints(e){return C(e).map(t=>new js(t.x,t.y))}deserializeLabel(e,t){if(e&&typeof e=="object"){const s=this.findFont(e.labelStyle,t),i=J.deserializeBounds(e),o=new qs(s,i);if("color"in e)return o.extensions.color=e.color,o;if(s||i)return o}}findFont(e,t){let s;return e&&(s=this.convertedFonts.get(e),s||this.parsingMessageCollector.warning(new Ws(t,e))),s}}const Js=n=>"source"in n||"target"in n;class ei{constructor(e){this.convertedElements=e}deserialize(e){for(const t of At){const s=e[t+"EventDefinition"];for(const i of C(s,!0))this.convertedElements.registerEventDefinitionsOfDefinition(i.id,{id:i.id,kind:t,...Js(i)?{source:i.source,target:i.target}:{}})}}}class ti{constructor(e){this.convertedElements=e}deserialize(e){this.parseGlobalTasks(e.globalTask,h.GLOBAL_TASK),this.parseGlobalTasks(e.globalBusinessRuleTask,h.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(e.globalManualTask,h.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(e.globalScriptTask,h.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(e.globalUserTask,h.GLOBAL_TASK_USER)}parseGlobalTasks(e,t){for(const s of C(e))this.convertedElements.registerGlobalTask(s.id,t)}}const ni=(n,e)=>{switch(n){case"adHocSubProcess":return D.AD_HOC;case"transaction":return D.TRANSACTION;default:return e.triggeredByEvent?D.EVENT:D.EMBEDDED}},si=["adHocSubProcess","transaction",...I.flowNodeKinds().filter(n=>n!==h.EVENT_BOUNDARY),h.EVENT_BOUNDARY];function ii(n){return["adHocSubProcess","transaction"].includes(n)?h.SUB_PROCESS:n}class oi{constructor(e,t){g(this,"defaultSequenceFlowIds",[]);g(this,"elementsWithoutParentByProcessId",new Map);g(this,"callActivitiesCallingProcess",new Map);g(this,"eventsByLinkEventDefinition",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){for(const t of C(e))this.parseProcess(t);for(const t of C(e))this.assignParentOfProcessElementsCalledByCallActivity(t.id);this.assignIncomingAndOutgoingIdsFromFlows(),this.assignSourceAndTargetIdsToLinkEvents()}assignParentOfProcessElementsCalledByCallActivity(e){const t=this.callActivitiesCallingProcess.get(e);if(t){const s=this.convertedElements.findPoolByProcessRef(e);s&&(s.parentId=t.id);for(const i of this.elementsWithoutParentByProcessId.get(e))i.parentId=t.id}}assignIncomingAndOutgoingIdsFromFlows(){const e=(t,s,i)=>{const o=this.convertedElements.findFlowNode(t)??this.convertedElements.findLane(t)??this.convertedElements.findPoolById(t);o&&!o[s].includes(i)&&o[s].push(i)};for(const t of this.convertedElements.getFlows())e(t.sourceReferenceId,"outgoingIds",t.id),e(t.targetReferenceId,"incomingIds",t.id)}assignSourceAndTargetIdsToLinkEvents(){var t;const e=[...this.eventsByLinkEventDefinition.entries()].filter(([s])=>s.id);for(const[s,i]of this.eventsByLinkEventDefinition)if(i instanceof Ge){const o=e.find(([r])=>s.target===r.id);i.targetId=(t=o==null?void 0:o[1])==null?void 0:t.id}else i instanceof Be&&(i.sourceIds=e.filter(([o])=>Array.isArray(s.source)?s.source.includes(o.id):s.source===o.id).map(([,o])=>o.id))}parseProcess(e){const t=e.id,s=this.convertedElements.findPoolByProcessRef(t);s&&!s.name&&this.convertedElements.registerPool(new Y(s.id,e.name,h.POOL),t),this.buildProcessInnerElements(e,s==null?void 0:s.id)}buildProcessInnerElements(e,t){this.elementsWithoutParentByProcessId.set(e.id,[]);for(const s of si)this.buildFlowNodeBpmnElements(e[s],ii(s),t,e.id,s);this.buildLaneSetBpmnElements(e.laneSet,t,e.id),this.buildSequenceFlows(e.sequenceFlow),this.buildAssociationFlows(e.association)}buildFlowNodeBpmnElements(e,t,s,i,o){for(const r of C(e)){const l=this.buildFlowNodeBpmnElement(t,r,s,o);"default"in r&&I.isWithDefaultSequenceFlow(t)&&this.defaultSequenceFlowIds.push(r.default),l&&(this.convertedElements.registerFlowNode(l),s||this.elementsWithoutParentByProcessId.get(i).push(l))}}buildFlowNodeBpmnElement(e,t,s,i){if(I.isEvent(e))return this.buildShapeBpmnEvent(t,e,s);if(I.isActivity(e))return this.buildShapeBpmnActivity(t,e,s,i);if(e==h.GATEWAY_EVENT_BASED){const o=t;return new wt(o.id,o.name,s,o.instantiate,de[o.eventGatewayType])}else{if(e==h.GROUP)return Gt(this.convertedElements,this.parsingMessageCollector,t,s);{const o=e===h.TEXT_ANNOTATION?t.text:t.name;return new Y(t.id,o,e,s,t.instantiate)}}}buildShapeBpmnActivity(e,t,s,i){const o=ri(e);return I.isSubProcess(t)?this.buildShapeBpmnSubProcess(e,s,ni(i,e),o):I.isCallActivity(t)?this.buildShapeBpmnCallActivity(e,s,o):new Le(e.id,e.name,t,s,e.instantiate,o)}buildShapeBpmnCallActivity(e,t,s){const i=this.convertedElements.findGlobalTask(e.calledElement);if(!i){const o=new j(e.id,e.name,ue.CALLING_PROCESS,t,s);return this.callActivitiesCallingProcess.set(e.calledElement,o),o}return new j(e.id,e.name,ue.CALLING_GLOBAL_TASK,t,s,i)}buildShapeBpmnEvent(e,t,s){const i=this.getEventDefinitions(e),o=[...i.entries()].map(([,r])=>r.length).reduce((r,l)=>r+l,0);if(o==0&&I.canHaveNoneEvent(t))return new K(e.id,e.name,t,R.NONE,s);if(o==1){const[r,l]=[...i.entries()][0],a=I.isCatchEvent(t)?this.buildShapeBpmnCatchEvent(e,t,r,s):this.buildShapeBpmnThrowEvent(e,t,r,s);return r===R.LINK&&(l[0].id||l[0].target||l[0].source)&&this.eventsByLinkEventDefinition.set(l[0],a),a}}buildShapeBpmnCatchEvent(e,t,s,i){return I.isBoundaryEvent(t)?this.buildShapeBpmnBoundaryEvent(e,s):I.isStartEvent(t)?new yt(e.id,e.name,s,i,e.isInterrupting):new Be(e.id,e.name,s,i)}buildShapeBpmnThrowEvent(e,t,s,i){return I.isIntermediateThrowEvent(t)?new Ge(e.id,e.name,s,i):new K(e.id,e.name,t,s,i)}buildShapeBpmnBoundaryEvent(e,t){const s=this.convertedElements.findFlowNode(e.attachedToRef);if(I.isActivity(s==null?void 0:s.kind))return new _t(e.id,e.name,t,e.attachedToRef,e.cancelActivity);this.parsingMessageCollector.warning(new Ks(e.id,e.attachedToRef,s==null?void 0:s.kind))}getEventDefinitions(e){const t=new Map;for(const s of At){const i=e[`${s}EventDefinition`];t.set(s,C(i,!0))}for(const s of C(e.eventDefinitionRef)){const i=this.convertedElements.findEventDefinitionOfDefinition(s);t.get(i.kind).push(i)}for(const[s]of[...t.entries()].filter(([,i])=>i.length===0))t.delete(s);return t}buildShapeBpmnSubProcess(e,t,s,i){const o=new fe(e.id,e.name,s,t,i);return this.buildProcessInnerElements(e,e.id),o}buildLaneSetBpmnElements(e,t,s){for(const i of C(e))this.buildLaneBpmnElements(i.lane,t,s)}buildLaneBpmnElements(e,t,s){var i;for(const o of C(e)){const r=new Y(o.id,o.name,h.LANE,t);this.convertedElements.registerLane(r),t||this.elementsWithoutParentByProcessId.get(s).push(r),this.assignParentOfLaneFlowNodes(o),(i=o.childLaneSet)!=null&&i.lane&&this.buildLaneBpmnElements(o.childLaneSet.lane,o.id,s)}}assignParentOfLaneFlowNodes(e){for(const t of C(e.flowNodeRef)){const s=this.convertedElements.findFlowNode(t),i=e.id;s?I.isBoundaryEvent(s.kind)||(s.parentId=i):this.parsingMessageCollector.warning(new Hs(i,t))}}buildSequenceFlows(e){for(const t of C(e)){const s=this.getSequenceFlowKind(t);this.convertedElements.registerSequenceFlow(new Ot(t.id,t.name,t.sourceRef,t.targetRef,s))}}buildAssociationFlows(e){for(const t of C(e)){const s=t.associationDirection;this.convertedElements.registerAssociationFlow(new vt(t.id,void 0,t.sourceRef,t.targetRef,s))}}getSequenceFlowKind(e){if(this.defaultSequenceFlowIds.includes(e.id))return V.DEFAULT;{const t=this.convertedElements.findFlowNode(e.sourceRef);if(t&&I.isWithDefaultSequenceFlow(t.kind)&&e.conditionExpression)return I.isActivity(t.kind)?V.CONDITIONAL_FROM_ACTIVITY:V.CONDITIONAL_FROM_GATEWAY}return V.NORMAL}}const ri=n=>{const e=[],t=n.standardLoopCharacteristics,s=C(n.multiInstanceLoopCharacteristics,!0)[0];return t!==void 0?e.push(w.LOOP):s&&e.push(s.isSequential?w.MULTI_INSTANCE_SEQUENTIAL:w.MULTI_INSTANCE_PARALLEL),e};class li{constructor(e,t,s,i,o,r){this.categoryConverter=e,this.collaborationConverter=t,this.eventDefinitionConverter=s,this.globalTaskConverter=i,this.processConverter=o,this.diagramConverter=r}parse(e){const t=e.definitions;return this.categoryConverter.deserialize(t),this.collaborationConverter.deserialize(t.collaboration),this.eventDefinitionConverter.deserialize(t),this.globalTaskConverter.deserialize(t),this.processConverter.deserialize(t.process),this.diagramConverter.deserialize(t.BPMNDiagram)}}function ai(n){const e=new zs;return new li(new Gs(e),new Xs(e,n),new ei(e),new ti(e),new oi(e,n),new J(e,n))}var $e={},_e={};(function(n){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",t=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s="["+e+"]["+t+"]*",i=new RegExp("^"+s+"$"),o=function(l,a){const u=[];let d=a.exec(l);for(;d;){const f=[];f.startIndex=a.lastIndex-d[0].length;const T=d.length;for(let E=0;E"u")};n.isExist=function(l){return typeof l<"u"},n.isEmptyObject=function(l){return Object.keys(l).length===0},n.merge=function(l,a,u){if(a){const d=Object.keys(a),f=d.length;for(let T=0;T"&&n[o]!==" "&&n[o]!==" "&&n[o]!==`
+`&&n[o]!=="\r";o++)a+=n[o];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),o--),!Ei(a)){let f;return a.trim().length===0?f="Invalid space after '<'.":f="Tag '"+a+"' is an invalid name.",y("InvalidTag",f,b(n,o))}const u=hi(n,o);if(u===!1)return y("InvalidAttr","Attributes for '"+a+"' have open quote.",b(n,o));let d=u.value;if(o=u.index,d[d.length-1]==="/"){const f=o-d.length;d=d.substring(0,d.length-1);const T=St(d,e);if(T===!0)s=!0;else return y(T.err.code,T.err.msg,b(n,f+T.err.line))}else if(l)if(u.tagClosed){if(d.trim().length>0)return y("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",b(n,r));{const f=t.pop();if(a!==f.tagName){let T=b(n,f.tagStartPos);return y("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+T.line+", col "+T.col+") instead of closing tag '"+a+"'.",b(n,r))}t.length==0&&(i=!0)}}else return y("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",b(n,o));else{const f=St(d,e);if(f!==!0)return y(f.err.code,f.err.msg,b(n,o-d.length+f.err.line));if(i===!0)return y("InvalidXml","Multiple possible root nodes found.",b(n,o));e.unpairedTags.indexOf(a)!==-1||t.push({tagName:a,tagStartPos:r}),s=!0}for(o++;o0)return y("InvalidXml","Invalid '"+JSON.stringify(t.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return y("InvalidXml","Start tag expected.",1);return!0};function Tt(n){return n===" "||n===" "||n===`
+`||n==="\r"}function pt(n,e){const t=e;for(;e5&&s==="xml")return y("InvalidXml","XML declaration allowed only at the start of the document.",b(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function Et(n,e){if(n.length>e+5&&n[e+1]==="-"&&n[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(n.length>e+8&&n[e+1]==="D"&&n[e+2]==="O"&&n[e+3]==="C"&&n[e+4]==="T"&&n[e+5]==="Y"&&n[e+6]==="P"&&n[e+7]==="E"){let t=1;for(e+=8;e"&&(t--,t===0))break}else if(n.length>e+9&&n[e+1]==="["&&n[e+2]==="C"&&n[e+3]==="D"&&n[e+4]==="A"&&n[e+5]==="T"&&n[e+6]==="A"&&n[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}const ui='"',di="'";function hi(n,e){let t="",s="",i=!1;for(;e"&&s===""){i=!0;break}t+=n[e]}return s!==""?!1:{value:t,index:e,tagClosed:i}}const fi=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function St(n,e){const t=Ze.getAllMatches(n,fi),s={};for(let i=0;i!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n}},Si=function(n){return Object.assign({},Vt,n)};je.buildOptions=Si;je.defaultOptions=Vt;class Ii{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}var mi=Ii;const Ci=_e;function Ai(n,e){const t={};if(n[e+3]==="O"&&n[e+4]==="C"&&n[e+5]==="T"&&n[e+6]==="Y"&&n[e+7]==="P"&&n[e+8]==="E"){e=e+9;let s=1,i=!1,o=!1,r="";for(;e"){if(o?n[e-1]==="-"&&n[e-2]==="-"&&(o=!1,s--):s--,s===0)break}else n[e]==="["?i=!0:r+=n[e];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:t,i:e}}function Oi(n,e){let t="";for(;e0&&i&&t[2]!==".")return n;if(!e.leadingZeros&&o.length>0&&!i&&t[1]!==".")return n;{const a=Number(t),u=""+a;return u.search(/[eE]/)!==-1||l?e.eNotation?a:n:t.indexOf(".")!==-1?u==="0"&&r===""||u===r||i&&u==="-"+r?a:n:o?r===u||i+r===u?a:n:t===u||t===i+u?a:n}}else return n}}function xi(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substr(0,n.length-1))),n}var Mi=ki;const qe=_e,ae=mi,Bi=Ri,Gi=Mi;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,qe.nameRegexp);let Vi=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=Yi,this.parseXml=Ki,this.parseTextData=Ui,this.resolveNameSpace=Di,this.buildAttributesMap=Hi,this.isItStopNode=Zi,this.replaceEntitiesValue=Xi,this.readStopNodeData=qi,this.saveTextToParentTag=$i,this.addChild=zi}};function Yi(n){const e=Object.keys(n);for(let t=0;t0)){r||(n=this.replaceEntitiesValue(n));const l=this.options.tagValueProcessor(e,n,t,i,o);return l==null?n:typeof l!=typeof n||l!==n?l:this.options.trimValues?We(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?We(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function Di(n){if(this.options.removeNSPrefix){const e=n.split(":"),t=n.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(n=t+e[1])}return n}const Wi=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Hi(n,e,t){if(!this.options.ignoreAttributes&&typeof n=="string"){const s=qe.getAllMatches(n,Wi),i=s.length,o={};for(let r=0;r",o,"Closing Tag is not closed.");let a=n.substring(o+2,l).trim();if(this.options.removeNSPrefix){const f=a.indexOf(":");f!==-1&&(a=a.substr(f+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&(s=this.saveTextToParentTag(s,t,i));const u=i.substring(i.lastIndexOf(".")+1);if(a&&this.options.unpairedTags.indexOf(a)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: ${a}>`);let d=0;u&&this.options.unpairedTags.indexOf(u)!==-1?(d=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):d=i.lastIndexOf("."),i=i.substring(0,d),t=this.tagsNodeStack.pop(),s="",o=l}else if(n[o+1]==="?"){let l=De(n,o,!1,"?>");if(!l)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,t,i),!(this.options.ignoreDeclaration&&l.tagName==="?xml"||this.options.ignorePiTags)){const a=new ae(l.tagName);a.add(this.options.textNodeName,""),l.tagName!==l.tagExp&&l.attrExpPresent&&(a[":@"]=this.buildAttributesMap(l.tagExp,i,l.tagName)),this.addChild(t,a,i)}o=l.closeIndex+1}else if(n.substr(o+1,3)==="!--"){const l=Z(n,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){const a=n.substring(o+4,l-2);s=this.saveTextToParentTag(s,t,i),t.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}o=l}else if(n.substr(o+1,2)==="!D"){const l=Bi(n,o);this.docTypeEntities=l.entities,o=l.i}else if(n.substr(o+1,2)==="!["){const l=Z(n,"]]>",o,"CDATA is not closed.")-2,a=n.substring(o+9,l);if(s=this.saveTextToParentTag(s,t,i),this.options.cdataPropName)t.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]);else{let u=this.parseTextData(a,t.tagname,i,!0,!1,!0);u==null&&(u=""),t.add(this.options.textNodeName,u)}o=l+2}else{let l=De(n,o,this.options.removeNSPrefix),a=l.tagName;const u=l.rawTagName;let d=l.tagExp,f=l.attrExpPresent,T=l.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&s&&t.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,t,i,!1));const E=t;if(E&&this.options.unpairedTags.indexOf(E.tagname)!==-1&&(t=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),a!==e.tagname&&(i+=i?"."+a:a),this.isItStopNode(this.options.stopNodes,i,a)){let S="";if(d.length>0&&d.lastIndexOf("/")===d.length-1)o=l.closeIndex;else if(this.options.unpairedTags.indexOf(a)!==-1)o=l.closeIndex;else{const P=this.readStopNodeData(n,u,T+1);if(!P)throw new Error(`Unexpected end of ${u}`);o=P.i,S=P.tagContent}const B=new ae(a);a!==d&&f&&(B[":@"]=this.buildAttributesMap(d,i,a)),S&&(S=this.parseTextData(S,a,i,!0,f,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),B.add(this.options.textNodeName,S),this.addChild(t,B,i)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),d=a):d=d.substr(0,d.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const S=new ae(a);a!==d&&f&&(S[":@"]=this.buildAttributesMap(d,i,a)),this.addChild(t,S,i),i=i.substr(0,i.lastIndexOf("."))}else{const S=new ae(a);this.tagsNodeStack.push(t),a!==d&&f&&(S[":@"]=this.buildAttributesMap(d,i,a)),this.addChild(t,S,i),t=S}s="",o=T}}else s+=n[o];return e.child};function zi(n,e,t){const s=this.options.updateTag(e.tagname,t,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),n.addChild(e))}const Xi=function(n){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];n=n.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];n=n.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];n=n.replace(t.regex,t.val)}n=n.replace(this.ampEntity.regex,this.ampEntity.val)}return n};function $i(n,e,t,s){return n&&(s===void 0&&(s=Object.keys(e.child).length===0),n=this.parseTextData(n,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,s),n!==void 0&&n!==""&&e.add(this.options.textNodeName,n),n=""),n}function Zi(n,e,t){const s="*."+t;for(const i in n){const o=n[i];if(s===o||e===o)return!0}return!1}function ji(n,e,t=">"){let s,i="";for(let o=e;o"){const i=ji(n,e+1,s);if(!i)return;let o=i.data;const r=i.index,l=o.search(/\s/);let a=o,u=!0;l!==-1&&(a=o.substr(0,l).replace(/\s\s*$/,""),o=o.substr(l+1));const d=a;if(t){const f=a.indexOf(":");f!==-1&&(a=a.substr(f+1),u=a!==i.data.substr(f+1))}return{tagName:a,tagExp:o,closeIndex:r,attrExpPresent:u,rawTagName:d}}function qi(n,e,t){const s=t;let i=1;for(;t",t,`${e} is not closed`);if(n.substring(t+2,o).trim()===e&&(i--,i===0))return{tagContent:n.substring(s,t),i:o};t=o}else if(n[t+1]==="?")t=Z(n,"?>",t+1,"StopNode is not closed.");else if(n.substr(t+1,3)==="!--")t=Z(n,"-->",t+3,"StopNode is not closed.");else if(n.substr(t+1,2)==="![")t=Z(n,"]]>",t,"StopNode is not closed.")-2;else{const o=De(n,t,">");o&&((o&&o.tagName)===e&&o.tagExp[o.tagExp.length-1]!=="/"&&i++,t=o.closeIndex)}}function We(n,e,t){if(e&&typeof n=="string"){const s=n.trim();return s==="true"?!0:s==="false"?!1:Gi(n,t)}else return qe.isExist(n)?n:""}var Qi=Vi,Yt={};function Ji(n,e){return Ut(n,e)}function Ut(n,e,t){let s;const i={};for(let o=0;o0&&(i[e.textNodeName]=s):s!==void 0&&(i[e.textNodeName]=s),i}function eo(n){const e=Object.keys(n);for(let t=0;t0&&(t=co),Dt(n,e,"",t)}function Dt(n,e,t,s){let i="",o=!1;for(let r=0;r`,o=!1;continue}else if(a===e.commentPropName){i+=s+``,o=!0;continue}else if(a[0]==="?"){const S=It(l[":@"],e),B=a==="?xml"?"":s;let P=l[a][0][e.textNodeName];P=P.length!==0?" "+P:"",i+=B+`<${a}${P}${S}?>`,o=!0;continue}let d=s;d!==""&&(d+=e.indentBy);const f=It(l[":@"],e),T=s+`<${a}${f}`,E=Dt(l[a],e,u,d);e.unpairedTags.indexOf(a)!==-1?e.suppressUnpairedNode?i+=T+">":i+=T+"/>":(!E||E.length===0)&&e.suppressEmptyNode?i+=T+"/>":E&&E.endsWith(">")?i+=T+`>${E}${s}${a}>`:(i+=T+">",E&&s!==""&&(E.includes("/>")||E.includes(""))?i+=s+e.indentBy+E+s:i+=E,i+=`${a}>`),o=!0}return i}function ho(n){const e=Object.keys(n);for(let t=0;t0&&e.processEntities)for(let t=0;t","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function X(n){this.options=Object.assign({},po,n),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Io),this.processTextOrObjNode=Eo,this.options.format?(this.indentate=So,this.tagEndChar=`>
`,this.newLine=`
-`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}z.prototype.build=function(n){return this.options.preserveOrder?uo(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0).val)};z.prototype.j2x=function(n,e){let t="",s="";for(let i in n)if(n.hasOwnProperty(i))if(typeof n[i]>"u")this.isAttribute(i)&&(s+="");else if(n[i]===null)this.isAttribute(i)?s+="":i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(n[i]instanceof Date)s+=this.buildTextValNode(n[i],i,"",e);else if(typeof n[i]!="object"){const o=this.isAttribute(i);if(o)t+=this.buildAttrPairStr(o,""+n[i]);else if(i===this.options.textNodeName){let r=this.options.tagValueProcessor(i,""+n[i]);s+=this.replaceEntitiesValue(r)}else s+=this.buildTextValNode(n[i],i,"",e)}else if(Array.isArray(n[i])){const o=n[i].length;let r="";for(let l=0;l"u"||(a===null?i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar:typeof a=="object"?this.options.oneListGroup?r+=this.j2x(a,e+1).val:r+=this.processTextOrObjNode(a,i,e):r+=this.buildTextValNode(a,i,"",e))}this.options.oneListGroup&&(r=this.buildObjectNode(r,i,"",e)),s+=r}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const o=Object.keys(n[i]),r=o.length;for(let l=0;l"+n+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&o.length===0?this.indentate(s)+``+this.newLine:this.indentate(s)+"<"+e+t+o+this.tagEndChar+n+this.indentate(s)+i}};z.prototype.closeTag=function(n){let e="";return this.options.unpairedTags.indexOf(n)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>${n}`,e};z.prototype.buildTextValNode=function(n,e,t,s){if(this.options.cdataPropName!==!1&&e===this.options.cdataPropName)return this.indentate(s)+``+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(s)+``+this.newLine;if(e[0]==="?")return this.indentate(s)+"<"+e+t+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(e,n);return i=this.replaceEntitiesValue(i),i===""?this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(s)+"<"+e+t+">"+i+""+e+this.tagEndChar}};z.prototype.replaceEntitiesValue=function(n){if(n&&n.length>0&&this.options.processEntities)for(let e=0;e"},{regex:/&(lt|#60|#x3c|#x3C);/g,val:"<"},{regex:/&(quot|#34|#x22);/g,val:'"'}];class Ao{constructor(e){g(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(e,t)=>this.processAttribute(t)});g(this,"xmlParser",new Io.XMLParser(this.x2jOptions));this.options=e}parse(e){let t;try{t=this.xmlParser.parse(e)}catch{throw new Error("XML parsing failed. Invalid BPMN source.")}if(!t.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return t}processAttribute(e){var t;for(const s of Co)e=e.replace(s.regex,s.val);return(t=this.options)!=null&&t.additionalXmlAttributeProcessor&&(e=this.options.additionalXmlAttributeProcessor(e)),e}}class Oo{constructor(e,t){this.jsonParser=e,this.xmlParser=t}parse(e){const t=this.xmlParser.parse(e);return this.jsonParser.parse(t)}}function No(n){return new Oo(ii(new Ms),new Ao(n))}function vo(n){return new Lo(n)}class Lo{constructor(e){this.graph=e}updateAndRefreshCssClassesOfCell(e,t){this.updateAndRefreshCssClassesOfElement(e,t),this.updateAndRefreshCssClassesOfElement(De(e),t)}updateAndRefreshCssClassesOfElement(e,t){const s=this.graph.getModel(),i=s.getCell(e);if(!i)return;let o=i.getStyle();o=F(o,I.EXTRA_CSS_CLASSES,t.join(",")),s.setStyle(i,o)}}function yo(n){return new _o(vo(n),new wo)}class _o{constructor(e,t){this.cssClassesUpdater=e,this.cssClassesCache=t}clearCache(){this.cssClassesCache.clear()}addCssClasses(e,t){this.updateCssClasses(e,t,this.cssClassesCache.addClassNames)}removeCssClasses(e,t){this.updateCssClasses(e,t,this.cssClassesCache.removeClassNames)}removeAllCssClasses(e){if(e||e=="")for(const t of m(e)){const s=this.cssClassesCache.removeAllClassNames(t);this.updateCellIfChanged(s,t)}else{const t=this.cssClassesCache.getBpmnIds();this.cssClassesCache.clear();for(const s of t)this.updateCellIfChanged(!0,s)}}toggleCssClasses(e,t){this.updateCssClasses(e,t,this.cssClassesCache.toggleClassNames)}updateCssClasses(e,t,s){const i=m(t);for(const o of m(e))this.updateCellIfChanged(s(o,i),o)}updateCellIfChanged(e,t){if(e){const s=this.cssClassesCache.getClassNames(t);this.cssClassesUpdater.updateAndRefreshCssClassesOfCell(t,s)}}}class wo{constructor(){g(this,"classNamesByBpmnId",new Map);g(this,"clear",()=>{this.classNamesByBpmnId.clear()});g(this,"addClassNames",(e,t)=>this.updateClassNames(e,t,(s,i)=>s.add(i)));g(this,"removeClassNames",(e,t)=>this.updateClassNames(e,t,(s,i)=>s.delete(i)));g(this,"toggleClassNames",(e,t)=>(this.updateClassNames(e,t,(s,i)=>s.has(i)?s.delete(i):s.add(i)),t&&t.length>0))}getClassNames(e){return this.classNamesByBpmnId.has(e)?[...this.classNamesByBpmnId.get(e)]:[]}getBpmnIds(){return[...this.classNamesByBpmnId.keys()]}removeAllClassNames(e){const t=this.getOrInitializeClassNames(e),s=t.size;return t.clear(),t.size g > g > g[data-bpmn-id="${e}"]`}elementsOfKind(e){return`svg > g > g > g.${e}:not(.bpmn-label)`}}function xo(n){return new Mo(n,new Bo(n.getModel()))}const Et=n=>{const e=m(n);return e.push(...e.map(t=>De(t))),e};class Mo{constructor(e,t){this.graph=e,this.styleManager=t}clear(){this.styleManager.clear()}updateStyle(e,t){if(!t)return;const s=this.graph.getModel(),i=Et(e).map(o=>s.getCell(o)).filter(Boolean);i.length!==0&&this.graph.batchUpdate(()=>{for(const o of i){this.styleManager.ensureStyleIsStored(o);let r=o.getStyle();r=F(r,c.STYLE_OPACITY,t.opacity,ye),r=hn(r,t.stroke),r=fn(r,t.font),En(t)&&(r=pn(r,t.fill)),s.setStyle(o,r)}})}resetStyle(e){this.graph.batchUpdate(()=>{if(e||e=="")for(const t of Et(e))this.styleManager.resetStyleIfIsStored(t);else this.styleManager.resetAllStyles()})}}const St=I.EXTRA_CSS_CLASSES;class Bo{constructor(e){g(this,"stylesCache",new Map);this.model=e}clear(){this.stylesCache.clear()}resetAllStyles(){for(const e of this.stylesCache.keys())this.resetStyle(e,this.stylesCache.get(e))}resetStyleIfIsStored(e){const t=this.stylesCache.get(e);t&&this.resetStyle(e,t)}resetStyle(e,t){const s=this.model.getCell(e),i=gn(s.getStyle(),St,""),o=F(t,St,i);this.model.setStyle(s,o),this.stylesCache.delete(e)}ensureStyleIsStored(e){const t=e.getId();this.stylesCache.has(t)||this.stylesCache.set(t,e.getStyle())}}function Go(n){return new Vo(xo(n))}class Vo{constructor(e){this.styleUpdater=e}clearCache(){this.styleUpdater.clear()}updateStyle(e,t){this.styleUpdater.updateStyle(e,t)}resetStyle(e){this.styleUpdater.resetStyle(e)}}function Yo(n,e){return new Uo(n,new Wo(e.container,new ko),yo(e),Fo(e),Go(e))}class Uo{constructor(e,t,s,i,o){this.bpmnModelRegistry=e,this.htmlElementRegistry=t,this.cssClassesRegistry=s,this.overlaysRegistry=i,this.styleRegistry=o,this.bpmnModelRegistry.registerOnLoadCallback(()=>{this.cssClassesRegistry.clearCache(),this.styleRegistry.clearCache()})}getModelElementsByIds(e){return m(e).map(t=>this.bpmnModelRegistry.getBpmnSemantic(t)).filter(Boolean)}getElementsByIds(e){return this.getModelElementsByIds(e).map(t=>({bpmnSemantic:t,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(t.id)}))}getModelElementsByKinds(e){return m(e).flatMap(t=>this.htmlElementRegistry.getBpmnHtmlElements(t)).map(t=>this.getRelatedBpmnSemantic(t))}getElementsByKinds(e){return m(e).flatMap(t=>this.htmlElementRegistry.getBpmnHtmlElements(t)).map(t=>({htmlElement:t,bpmnSemantic:this.getRelatedBpmnSemantic(t)}))}getRelatedBpmnSemantic(e){return this.bpmnModelRegistry.getBpmnSemantic(e.getAttribute("data-bpmn-id"))}addCssClasses(e,t){this.cssClassesRegistry.addCssClasses(e,t)}removeCssClasses(e,t){this.cssClassesRegistry.removeCssClasses(e,t)}removeAllCssClasses(e){this.cssClassesRegistry.removeAllCssClasses(e)}toggleCssClasses(e,t){this.cssClassesRegistry.toggleCssClasses(e,t)}addOverlays(e,t){this.overlaysRegistry.addOverlays(e,t)}removeAllOverlays(e){this.overlaysRegistry.removeAllOverlays(e)}updateStyle(e,t){this.styleRegistry.updateStyle(e,t)}resetStyle(e){this.styleRegistry.resetStyle(e)}}class Wo{constructor(e,t){this.container=e,this.querySelectors=t}getBpmnHtmlElement(e){return this.container.querySelector(this.querySelectors.element(e))}getBpmnHtmlElements(e){const t=this.querySelectors.elementsOfKind(Be(e));return[...this.container.querySelectorAll(t)]}}class Do{filter(e,t){const s=[],i=[];for(const E of m(t==null?void 0:t.pools).filter(S=>S&&Object.keys(S).length>0))E.id?s.push(E.id):E.name&&i.push(E.name);if(s.length===0&&i.length===0)return e;const{filteredPools:o,filteredPoolIds:r}=Ho(e,s,i),l=[...s,...r],{filteredLanes:a,filteredLaneIds:u,filteredFlowNodes:d,filteredFlowNodeIds:f}=Ut(e.lanes,e.flowNodes,l),T=zo(e.edges,[...l,...u,...f]);if(o.length===0&&a.length===0&&d.length===0&&T.length===0){let E=s.length>0?` for ids [${s}]`:"";const S=E?" and":"";throw E+=i.length>0?`${S} for names [${i}]`:"",new Error("No matching pools"+E)}return{lanes:a,flowNodes:d,pools:o,edges:T}}}function Ho(n,e,t){const s=n.pools.filter(o=>e.includes(o.bpmnElement.id)||t.includes(o.bpmnElement.name)),i=s.map(o=>o.bpmnElement.id);return{filteredPools:s,filteredPoolIds:i}}function Ut(n,e,t){const{filteredLanes:s,filteredLaneIds:i}=Wt(n,t),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=Ko(e,[...t,...i],n);return s.push(...o),i.push(...r),{filteredLanes:s,filteredLaneIds:i,filteredFlowNodes:l,filteredFlowNodeIds:a}}function Wt(n,e){const t=n.filter(i=>e.includes(i.bpmnElement.parentId)),s=t.map(i=>i.bpmnElement.id);if(t.length>0){const{filteredLanes:i,filteredLaneIds:o}=Wt(n,s);t.push(...i),s.push(...o)}return{filteredLanes:t,filteredLaneIds:s}}function Ko(n,e,t){const s=n.filter(u=>e.includes(u.bpmnElement.parentId));if(s.length===0)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const i=s.map(u=>u.bpmnElement.id),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=Ut(t,n,i);return s.push(...l),i.push(...a),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:s,filteredFlowNodeIds:i}}function zo(n,e){return n.filter(t=>e.includes(t.bpmnElement.sourceReferenceId)&&e.includes(t.bpmnElement.targetReferenceId))}class Xo{constructor(){g(this,"searchableModel");g(this,"onLoadCallback")}load(e,t){var i;const s=new Do().filter(e,t);return this.searchableModel=new Zo(s),(i=this.onLoadCallback)==null||i.call(this),$o(s)}registerOnLoadCallback(e){this.onLoadCallback=e}getBpmnSemantic(e){var o;const t=(o=this.searchableModel)==null?void 0:o.elementById(e);if(!t)return;const s=t.bpmnElement,i=s instanceof Y;return{id:e,isShape:i,kind:s.kind,name:s.name,...s instanceof ve?{sourceRefId:s.sourceReferenceId,targetRefId:s.targetReferenceId}:{callActivityGlobalTaskKind:s instanceof Z?s.globalTaskKind:void 0,callActivityKind:s instanceof Z?s.callActivityKind:void 0,eventDefinitionKind:s instanceof J?s.eventDefinitionKind:void 0,incomingIds:s.incomingIds,outgoingIds:s.outgoingIds,parentId:s.parentId,subProcessKind:s instanceof fe?s.subProcessKind:void 0}}}}function $o(n){const e=n.flowNodes.filter(o=>{const r=o.bpmnElement;return C.isSubProcess(r.kind)&&r.markers.includes(w.EXPAND)}).map(o=>o.bpmnElement.id),t=[],s=[],i=[];for(const o of n.flowNodes){const r=o.bpmnElement.kind;C.isSubProcess(r)?t.push(o):C.isBoundaryEvent(r)?s.push(o):e.includes(o.bpmnElement.parentId)||i.push(o)}return{boundaryEvents:s,edges:n.edges,lanes:n.lanes,otherFlowNodes:i,pools:n.pools,subprocesses:t}}class Zo{constructor(e){g(this,"elements",new Map);for(const t of[...e.pools,...e.lanes,...e.flowNodes,...e.edges])this.elements.set(t.bpmnElement.id,t)}elementById(e){return this.elements.get(e)}}const jo="0.41.0",qo=()=>({lib:jo,dependencies:new Map([["mxGraph",Ot.VERSION]])});class Qo{constructor(e){g(this,"graph");g(this,"navigation");g(this,"bpmnElementsRegistry");g(this,"bpmnModelRegistry");g(this,"parserOptions");g(this,"rendererOptions");this.rendererOptions=e==null?void 0:e.renderer;const t=new Ps(nn(e==null?void 0:e.container));this.graph=t.configure(e),this.navigation=new ks(this.graph),this.bpmnModelRegistry=new Xo,this.bpmnElementsRegistry=Yo(this.bpmnModelRegistry,this.graph),this.parserOptions=e==null?void 0:e.parser}load(e,t){const s=No(this.parserOptions).parse(e),i=this.bpmnModelRegistry.load(s,t==null?void 0:t.modelFilter);Cn(this.graph,this.rendererOptions).render(i,t==null?void 0:t.fit)}getVersion(){return qo()}}function Cr(n){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(n,1):document.addEventListener("DOMContentLoaded",n)}function A(n,...e){je("[DEMO]",n,...e)}function je(n,e,...t){console.info(`${n} ${e}`,...t)}function k(n,...e){je("[DEMO STARTUP]",n,...e)}function Dt(n,e){Ht(n),window.alert(e??n)}function Ht(n){console.error("[DEMO]",n)}function te(n,...e){je("[DEMO DOWNLOAD]",n,...e)}async function Jo(n){A(`Fetching BPMN content from url ${n}`);const e=await fetch(n);if(!e.ok)throw Error(`HTTP status ${e.status}`);return await e.text()}function Kt(n,e,t){const s=document.createElement("a");e.startsWith("data:image/svg+xml")&&(t=encodeURIComponent(t),e+=","),s.setAttribute("href",e+t),s.setAttribute("download",n),s.style.display="none",document.body.append(s),s.click(),s.remove()}function er(n){te("Start SVG download"),Kt("diagram.svg","data:image/svg+xml",n),te("Download completed")}function tr(n){te("Start PNG download");const e=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),t=URL.createObjectURL(e),s=document.createElement("img");s.setAttribute("style","position: absolute; top: -9999px"),s.crossOrigin="anonymous",document.body.append(s);const i=document.createElement("canvas"),o=i.getContext("2d");s.addEventListener("load",function(){const r=new Image;i.width=s.naturalWidth,i.height=s.naturalHeight,r.crossOrigin="Anonymous",r.addEventListener("load",function(){o.drawImage(r,0,0),URL.revokeObjectURL(t);const l=i.toDataURL("image/png");s.remove(),Kt("diagram.png","",l),te("Download completed")}),r.src=s.src}),s.src=t}class nr{constructor(e,t,s,i){g(this,"document");g(this,"head");g(this,"body");this.window=e,this.outerContainerId=t,this.containerToFade=s,this.dropCallback=i,this.document=e.document,this.head=document.head,this.body=document.body,this.initializeDragAndDrop()}initializeDragAndDrop(){this.containerToFade.classList.add("faded-container"),this.addDomElements(this.containerToFade),this.addStyle();const e=document.querySelector(`#${this.outerContainerId}`);this.preventDefaultsOnEvents(["dragover","drop"],this.window),this.preventDefaultsOnEvents(["dragover","dragleave","drop"],e),this.addEventsOnDropContainer(e,this.containerToFade),this.addEventsOnDocument(this.outerContainerId,this.containerToFade)}preventDefaults(e){e.preventDefault(),e.stopPropagation()}preventDefaultsOnEvents(e,t){for(const s of e)t.addEventListener(s,this.preventDefaults.bind(this),!1)}addDomElements(e){const t=this.document.createElement("p");t.textContent="open BPMN diagram";const s=this.document.createElement("div");s.classList.add("drop-here-text"),s.append(t);const i=this.document.createElement("div");i.id=this.outerContainerId,i.append(s),e.parentNode.prepend(i)}addStyle(){const e=`
+`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}X.prototype.build=function(n){return this.options.preserveOrder?To(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0).val)};X.prototype.j2x=function(n,e){let t="",s="";for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i))if(typeof n[i]>"u")this.isAttribute(i)&&(s+="");else if(n[i]===null)this.isAttribute(i)?s+="":i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(n[i]instanceof Date)s+=this.buildTextValNode(n[i],i,"",e);else if(typeof n[i]!="object"){const o=this.isAttribute(i);if(o)t+=this.buildAttrPairStr(o,""+n[i]);else if(i===this.options.textNodeName){let r=this.options.tagValueProcessor(i,""+n[i]);s+=this.replaceEntitiesValue(r)}else s+=this.buildTextValNode(n[i],i,"",e)}else if(Array.isArray(n[i])){const o=n[i].length;let r="";for(let l=0;l"u"||(a===null?i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar:typeof a=="object"?this.options.oneListGroup?r+=this.j2x(a,e+1).val:r+=this.processTextOrObjNode(a,i,e):r+=this.buildTextValNode(a,i,"",e))}this.options.oneListGroup&&(r=this.buildObjectNode(r,i,"",e)),s+=r}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const o=Object.keys(n[i]),r=o.length;for(let l=0;l"+n+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&o.length===0?this.indentate(s)+``+this.newLine:this.indentate(s)+"<"+e+t+o+this.tagEndChar+n+this.indentate(s)+i}};X.prototype.closeTag=function(n){let e="";return this.options.unpairedTags.indexOf(n)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>${n}`,e};X.prototype.buildTextValNode=function(n,e,t,s){if(this.options.cdataPropName!==!1&&e===this.options.cdataPropName)return this.indentate(s)+``+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(s)+``+this.newLine;if(e[0]==="?")return this.indentate(s)+"<"+e+t+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(e,n);return i=this.replaceEntitiesValue(i),i===""?this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(s)+"<"+e+t+">"+i+""+e+this.tagEndChar}};X.prototype.replaceEntitiesValue=function(n){if(n&&n.length>0&&this.options.processEntities)for(let e=0;e"},{regex:/&(lt|#60|#x3c|#x3C);/g,val:"<"},{regex:/&(quot|#34|#x22);/g,val:'"'}];class Lo{constructor(e){g(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(e,t)=>this.processAttribute(t)});g(this,"xmlParser",new No.XMLParser(this.x2jOptions));this.options=e}parse(e){let t;try{t=this.xmlParser.parse(e)}catch{throw new Error("XML parsing failed. Invalid BPMN source.")}if(!t.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return t}processAttribute(e){var t;for(const s of vo)e=e.replace(s.regex,s.val);return(t=this.options)!=null&&t.additionalXmlAttributeProcessor&&(e=this.options.additionalXmlAttributeProcessor(e)),e}}class yo{constructor(e,t){this.jsonParser=e,this.xmlParser=t}parse(e){const t=this.xmlParser.parse(e);return this.jsonParser.parse(t)}}function _o(n){return new yo(ai(new Vs),new Lo(n))}function wo(n){return new Ro(n)}class Ro{constructor(e){this.graph=e}updateAndRefreshCssClassesOfCell(e,t){this.updateAndRefreshCssClassesOfElement(e,t),this.updateAndRefreshCssClassesOfElement(ze(e),t)}updateAndRefreshCssClassesOfElement(e,t){const s=this.graph.getModel(),i=s.getCell(e);if(!i)return;let o=i.getStyle();o=F(o,m.EXTRA_CSS_CLASSES,t.join(",")),s.setStyle(i,o)}}function bo(n){return new Fo(wo(n),new Po)}class Fo{constructor(e,t){this.cssClassesUpdater=e,this.cssClassesCache=t}clearCache(){this.cssClassesCache.clear()}addCssClasses(e,t){this.updateCssClasses(e,t,this.cssClassesCache.addClassNames)}removeCssClasses(e,t){this.updateCssClasses(e,t,this.cssClassesCache.removeClassNames)}removeAllCssClasses(e){if(e||e=="")for(const t of C(e)){const s=this.cssClassesCache.removeAllClassNames(t);this.updateCellIfChanged(s,t)}else{const t=this.cssClassesCache.getBpmnIds();this.cssClassesCache.clear();for(const s of t)this.updateCellIfChanged(!0,s)}}toggleCssClasses(e,t){this.updateCssClasses(e,t,this.cssClassesCache.toggleClassNames)}updateCssClasses(e,t,s){const i=C(t);for(const o of C(e))this.updateCellIfChanged(s(o,i),o)}updateCellIfChanged(e,t){if(e){const s=this.cssClassesCache.getClassNames(t);this.cssClassesUpdater.updateAndRefreshCssClassesOfCell(t,s)}}}class Po{constructor(){g(this,"classNamesByBpmnId",new Map);g(this,"clear",()=>{this.classNamesByBpmnId.clear()});g(this,"addClassNames",(e,t)=>this.updateClassNames(e,t,(s,i)=>s.add(i)));g(this,"removeClassNames",(e,t)=>this.updateClassNames(e,t,(s,i)=>s.delete(i)));g(this,"toggleClassNames",(e,t)=>(this.updateClassNames(e,t,(s,i)=>s.has(i)?s.delete(i):s.add(i)),t&&t.length>0))}getClassNames(e){return this.classNamesByBpmnId.has(e)?[...this.classNamesByBpmnId.get(e)]:[]}getBpmnIds(){return[...this.classNamesByBpmnId.keys()]}removeAllClassNames(e){const t=this.getOrInitializeClassNames(e),s=t.size;return t.clear(),t.size g > g > g[data-bpmn-id="${e}"]`}elementsOfKind(e){return`svg > g > g > g.${e}:not(.bpmn-label)`}}function Vo(n){return new Yo(n,new Uo(n.getModel()))}const mt=n=>{const e=C(n);return e.push(...e.map(t=>ze(t))),e};class Yo{constructor(e,t){this.graph=e,this.styleManager=t}clear(){this.styleManager.clear()}updateStyle(e,t){if(!t)return;const s=this.graph.getModel(),i=mt(e).map(o=>s.getCell(o)).filter(Boolean);i.length!==0&&this.graph.batchUpdate(()=>{for(const o of i){this.styleManager.ensureStyleIsStored(o);let r=o.getStyle();r=F(r,c.STYLE_OPACITY,t.opacity,ye),r=Tn(r,t.stroke),r=pn(r,t.font),mn(t)&&(r=In(r,t.fill)),s.setStyle(o,r)}})}resetStyle(e){this.graph.batchUpdate(()=>{if(e||e=="")for(const t of mt(e))this.styleManager.resetStyleIfIsStored(t);else this.styleManager.resetAllStyles()})}}const Ct=m.EXTRA_CSS_CLASSES;class Uo{constructor(e){g(this,"stylesCache",new Map);this.model=e}clear(){this.stylesCache.clear()}resetAllStyles(){for(const e of this.stylesCache.keys())this.resetStyle(e,this.stylesCache.get(e))}resetStyleIfIsStored(e){const t=this.stylesCache.get(e);t&&this.resetStyle(e,t)}resetStyle(e,t){const s=this.model.getCell(e),i=En(s.getStyle(),Ct,""),o=F(t,Ct,i);this.model.setStyle(s,o),this.stylesCache.delete(e)}ensureStyleIsStored(e){const t=e.getId();this.stylesCache.has(t)||this.stylesCache.set(t,e.getStyle())}}function Do(n){return new Wo(Vo(n))}class Wo{constructor(e){this.styleUpdater=e}clearCache(){this.styleUpdater.clear()}updateStyle(e,t){this.styleUpdater.updateStyle(e,t)}resetStyle(e){this.styleUpdater.resetStyle(e)}}function Ho(n,e){return new Ko(n,new zo(e.container,new Go),bo(e),Mo(e),Do(e))}class Ko{constructor(e,t,s,i,o){this.bpmnModelRegistry=e,this.htmlElementRegistry=t,this.cssClassesRegistry=s,this.overlaysRegistry=i,this.styleRegistry=o,this.bpmnModelRegistry.registerOnLoadCallback(()=>{this.cssClassesRegistry.clearCache(),this.styleRegistry.clearCache()})}getModelElementsByIds(e){return Pe(e).map(t=>this.bpmnModelRegistry.getBpmnSemantic(t)).filter(Boolean)}getElementsByIds(e){return this.getModelElementsByIds(e).map(t=>({bpmnSemantic:t,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(t.id)}))}getModelElementsByKinds(e){return Pe(e).flatMap(t=>this.htmlElementRegistry.getBpmnHtmlElements(t)).map(t=>this.getRelatedBpmnSemantic(t))}getElementsByKinds(e){return Pe(e).flatMap(t=>this.htmlElementRegistry.getBpmnHtmlElements(t)).map(t=>({htmlElement:t,bpmnSemantic:this.getRelatedBpmnSemantic(t)}))}getRelatedBpmnSemantic(e){return this.bpmnModelRegistry.getBpmnSemantic(e.dataset.bpmnId)}addCssClasses(e,t){this.cssClassesRegistry.addCssClasses(e,t)}removeCssClasses(e,t){this.cssClassesRegistry.removeCssClasses(e,t)}removeAllCssClasses(e){this.cssClassesRegistry.removeAllCssClasses(e)}toggleCssClasses(e,t){this.cssClassesRegistry.toggleCssClasses(e,t)}addOverlays(e,t){this.overlaysRegistry.addOverlays(e,t)}removeAllOverlays(e){this.overlaysRegistry.removeAllOverlays(e)}updateStyle(e,t){this.styleRegistry.updateStyle(e,t)}resetStyle(e){this.styleRegistry.resetStyle(e)}}class zo{constructor(e,t){this.container=e,this.querySelectors=t}getBpmnHtmlElement(e){return this.container.querySelector(this.querySelectors.element(e))}getBpmnHtmlElements(e){const t=this.querySelectors.elementsOfKind(Ye(e));return[...this.container.querySelectorAll(t)]}}const Pe=n=>[...new Set(C(n))];class Xo{filter(e,t){const s=[],i=[];for(const E of C(t==null?void 0:t.pools).filter(S=>S&&Object.keys(S).length>0))E.id?s.push(E.id):E.name&&i.push(E.name);if(s.length===0&&i.length===0)return e;const{filteredPools:o,filteredPoolIds:r}=$o(e,s,i),l=[...s,...r],{filteredLanes:a,filteredLaneIds:u,filteredFlowNodes:d,filteredFlowNodeIds:f}=Ht(e.lanes,e.flowNodes,l),T=jo(e.edges,[...l,...u,...f]);if(o.length===0&&a.length===0&&d.length===0&&T.length===0){let E=s.length>0?` for ids [${s}]`:"";const S=E?" and":"";throw E+=i.length>0?`${S} for names [${i}]`:"",new Error("No matching pools"+E)}return{lanes:a,flowNodes:d,pools:o,edges:T}}}function $o(n,e,t){const s=n.pools.filter(o=>e.includes(o.bpmnElement.id)||t.includes(o.bpmnElement.name)),i=s.map(o=>o.bpmnElement.id);return{filteredPools:s,filteredPoolIds:i}}function Ht(n,e,t){const{filteredLanes:s,filteredLaneIds:i}=Kt(n,t),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=Zo(e,[...t,...i],n);return s.push(...o),i.push(...r),{filteredLanes:s,filteredLaneIds:i,filteredFlowNodes:l,filteredFlowNodeIds:a}}function Kt(n,e){const t=n.filter(i=>e.includes(i.bpmnElement.parentId)),s=t.map(i=>i.bpmnElement.id);if(t.length>0){const{filteredLanes:i,filteredLaneIds:o}=Kt(n,s);t.push(...i),s.push(...o)}return{filteredLanes:t,filteredLaneIds:s}}function Zo(n,e,t){const s=n.filter(u=>e.includes(u.bpmnElement.parentId));if(s.length===0)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const i=s.map(u=>u.bpmnElement.id),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=Ht(t,n,i);return s.push(...l),i.push(...a),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:s,filteredFlowNodeIds:i}}function jo(n,e){return n.filter(t=>e.includes(t.bpmnElement.sourceReferenceId)&&e.includes(t.bpmnElement.targetReferenceId))}class qo{constructor(){g(this,"searchableModel");g(this,"onLoadCallback")}load(e,t){var i;const s=new Xo().filter(e,t);return this.searchableModel=new Jo(s),(i=this.onLoadCallback)==null||i.call(this),Qo(s)}registerOnLoadCallback(e){this.onLoadCallback=e}getBpmnSemantic(e){var o;const t=(o=this.searchableModel)==null?void 0:o.elementById(e);if(!t)return;const s=t.bpmnElement,i=s instanceof Y;return{id:e,isShape:i,kind:s.kind,name:s.name,...s instanceof ve?{sourceRefId:s.sourceReferenceId,targetRefId:s.targetReferenceId}:{callActivityGlobalTaskKind:s instanceof j?s.globalTaskKind:void 0,callActivityKind:s instanceof j?s.callActivityKind:void 0,eventDefinitionKind:s instanceof K?s.eventDefinitionKind:void 0,linkEventSourceIds:s instanceof Be&&s.eventDefinitionKind==R.LINK?s.sourceIds:void 0,linkEventTargetId:s instanceof Ge?s.targetId:void 0,incomingIds:s.incomingIds,outgoingIds:s.outgoingIds,parentId:s.parentId,subProcessKind:s instanceof fe?s.subProcessKind:void 0}}}}function Qo(n){const e=new Set(n.flowNodes.filter(o=>{const r=o.bpmnElement;return I.isSubProcess(r.kind)&&r.markers.includes(w.EXPAND)}).map(o=>o.bpmnElement.id)),t=[],s=[],i=[];for(const o of n.flowNodes){const r=o.bpmnElement.kind;I.isSubProcess(r)?t.push(o):I.isBoundaryEvent(r)?s.push(o):e.has(o.bpmnElement.parentId)||i.push(o)}return{boundaryEvents:s,edges:n.edges,lanes:n.lanes,otherFlowNodes:i,pools:n.pools,subprocesses:t}}class Jo{constructor(e){g(this,"elements",new Map);for(const t of[...e.pools,...e.lanes,...e.flowNodes,...e.edges])this.elements.set(t.bpmnElement.id,t)}elementById(e){return this.elements.get(e)}}const er="0.42.0",tr=()=>({lib:er,dependencies:new Map([["mxGraph",Lt.VERSION]])});class nr{constructor(e){g(this,"graph");g(this,"navigation");g(this,"bpmnElementsRegistry");g(this,"bpmnModelRegistry");g(this,"parserOptions");g(this,"rendererOptions");this.rendererOptions=e==null?void 0:e.renderer;const t=new Ms(rn(e==null?void 0:e.container));this.graph=t.configure(e),this.navigation=new Bs(this.graph),this.bpmnModelRegistry=new qo,this.bpmnElementsRegistry=Ho(this.bpmnModelRegistry,this.graph),this.parserOptions=e==null?void 0:e.parser}load(e,t){const s=_o(this.parserOptions).parse(e),i=this.bpmnModelRegistry.load(s,t==null?void 0:t.modelFilter);Nn(this.graph,this.rendererOptions).render(i,t==null?void 0:t.fit)}getVersion(){return tr()}}function vr(n){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(n,1):document.addEventListener("DOMContentLoaded",n)}function A(n,...e){Je("[DEMO]",n,...e)}function Je(n,e,...t){console.info(`${n} ${e}`,...t)}function k(n,...e){Je("[DEMO STARTUP]",n,...e)}function zt(n,e){Xt(n),window.alert(e??n)}function Xt(n){console.error("[DEMO]",n)}function te(n,...e){Je("[DEMO DOWNLOAD]",n,...e)}async function sr(n){A(`Fetching BPMN content from url ${n}`);const e=await fetch(n);if(!e.ok)throw new Error(`HTTP status ${e.status}`);return await e.text()}function $t(n,e,t){const s=document.createElement("a");e.startsWith("data:image/svg+xml")&&(t=encodeURIComponent(t),e+=","),s.setAttribute("href",e+t),s.setAttribute("download",n),s.style.display="none",document.body.append(s),s.click(),s.remove()}function ir(n){te("Start SVG download"),$t("diagram.svg","data:image/svg+xml",n),te("Download completed")}function or(n){te("Start PNG download");const e=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),t=URL.createObjectURL(e),s=document.createElement("img");s.setAttribute("style","position: absolute; top: -9999px"),s.crossOrigin="anonymous",document.body.append(s);const i=document.createElement("canvas"),o=i.getContext("2d");s.addEventListener("load",function(){const r=new Image;i.width=s.naturalWidth,i.height=s.naturalHeight,r.crossOrigin="Anonymous",r.addEventListener("load",function(){o.drawImage(r,0,0),URL.revokeObjectURL(t);const l=i.toDataURL("image/png");s.remove(),$t("diagram.png","",l),te("Download completed")}),r.src=s.src}),s.src=t}class rr{constructor(e,t,s,i){g(this,"document");g(this,"head");g(this,"body");this.window=e,this.outerContainerId=t,this.containerToFade=s,this.dropCallback=i,this.document=e.document,this.head=document.head,this.body=document.body,this.initializeDragAndDrop()}initializeDragAndDrop(){this.containerToFade.classList.add("faded-container"),this.addDomElements(this.containerToFade),this.addStyle();const e=document.querySelector(`#${this.outerContainerId}`);this.preventDefaultsOnEvents(["dragover","drop"],this.window),this.preventDefaultsOnEvents(["dragover","dragleave","drop"],e),this.addEventsOnDropContainer(e,this.containerToFade),this.addEventsOnDocument(this.outerContainerId,this.containerToFade)}preventDefaults(e){e.preventDefault(),e.stopPropagation()}preventDefaultsOnEvents(e,t){for(const s of e)t.addEventListener(s,this.preventDefaults.bind(this),!1)}addDomElements(e){const t=this.document.createElement("p");t.textContent="open BPMN diagram";const s=this.document.createElement("div");s.classList.add("drop-here-text"),s.append(t);const i=this.document.createElement("div");i.id=this.outerContainerId,i.append(s),e.parentNode.prepend(i)}addStyle(){const e=`
.faded-container {
opacity: 1;
}
@@ -47,7 +47,7 @@ var Qt=Object.defineProperty;var Jt=(n,e,t)=>e in n?Qt(n,e,{enumerable:!0,config
align-items: center;
border: 2px dashed rgba(0,0,0,.2);
border-radius: 7px;
-}`,t=document.createElement("style");t.append(document.createTextNode(e)),this.head.append(t)}addEventsOnDropContainer(e,t){e.addEventListener("dragover",this.getAddClassCallback(t,!1),!1),e.addEventListener("mousedown",this.getRemoveClassCallback(t,!1),!1),e.addEventListener("drop",this.getDropCallbackForElement(t,!1,this.dropCallback),!1)}addEventsOnDocument(e,t){this.document.addEventListener("dragover",this.getAddClassCallback(t,!0,e),!1),this.document.addEventListener("dragleave",this.getRemoveClassCallback(t,!0,e),!1),this.document.addEventListener("drop",this.getDropCallbackForElement(t,!0,this.dropCallback,e),!1)}getAddClassCallback(e,t,s){return function(){t?this.querySelector("#"+s).classList.add("dragging"):this.classList.add("dragging"),e.classList.add("faded")}}getRemoveClassCallback(e,t,s){return function(){t?this.querySelector("#"+s).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}getDropCallbackForElement(e,t,s,i){return function(o){try{const l=o.dataTransfer.files;s(l[0])}catch(r){const l=r instanceof Error?r.message:String(r);Dt(l)}finally{t?this.querySelector("#"+i).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}}}class zt{constructor(e){this.graph=e}exportSvg(){return this.doSvgExport(!0)}exportSvgForPng(){const e=Ot.IS_FF;return this.doSvgExport(e)}doSvgExport(e){const t=this.computeSvg({scale:1,border:25,enableForeignObjectForLabel:e});return`
+}`,t=document.createElement("style");t.append(document.createTextNode(e)),this.head.append(t)}addEventsOnDropContainer(e,t){e.addEventListener("dragover",this.getAddClassCallback(t,!1),!1),e.addEventListener("mousedown",this.getRemoveClassCallback(t,!1),!1),e.addEventListener("drop",this.getDropCallbackForElement(t,!1,this.dropCallback),!1)}addEventsOnDocument(e,t){this.document.addEventListener("dragover",this.getAddClassCallback(t,!0,e),!1),this.document.addEventListener("dragleave",this.getRemoveClassCallback(t,!0,e),!1),this.document.addEventListener("drop",this.getDropCallbackForElement(t,!0,this.dropCallback,e),!1)}getAddClassCallback(e,t,s){return function(){t?this.querySelector("#"+s).classList.add("dragging"):this.classList.add("dragging"),e.classList.add("faded")}}getRemoveClassCallback(e,t,s){return function(){t?this.querySelector("#"+s).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}getDropCallbackForElement(e,t,s,i){return function(o){try{const l=o.dataTransfer.files;s(l[0])}catch(r){const l=r instanceof Error?r.message:String(r);zt(l)}finally{t?this.querySelector("#"+i).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}}}class Zt{constructor(e){this.graph=e}exportSvg(){return this.doSvgExport(!0)}exportSvgForPng(){const e=Lt.IS_FF;return this.doSvgExport(e)}doSvgExport(e){const t=this.computeSvg({scale:1,border:25,enableForeignObjectForLabel:e});return`
${O.getXml(t)}
-`}computeSvg(e){const t=e.scale??1,s=e.border??0,i=e.crisp??!0,o=e.enableForeignObjectForLabel??!0,r=this.graph.getGraphBounds(),l=this.graph.view.scale,a=O.createXmlDocument(),u=a.createElementNS(c.NS_SVG,"svg"),d=t/l,f=Math.max(1,Math.ceil(r.width*d)+2*s),T=Math.max(1,Math.ceil(r.height*d)+2*s);u.setAttribute("version","1.1"),u.setAttribute("width",f+"px"),u.setAttribute("height",T+"px"),u.setAttribute("viewBox",(i?"-0.5 -0.5":"0 0")+" "+f+" "+T),a.append(u);const E=a.createElementNS(c.NS_SVG,"g");u.append(E);const S=this.createSvgCanvas(E);S.foEnabled=o,S.foOffset=i?-.5:0,S.textOffset=i?-.5:0,S.imageOffset=i?-.5:0,S.translate(Math.floor((s/t-r.x)/l),Math.floor((s/t-r.y)/l)),S.scale(d);const B=new L.mxImageExport;return B.includeOverlays=!0,B.drawState(this.graph.getView().getState(this.graph.model.root),S),a}createSvgCanvas(e){const t=new sr(e);return t.pointerEvents=!0,t}}class sr extends he{constructor(t){super(t);g(this,"htmlConverter",document.createElement("div"))}getAlternateText(t,s,i,o,r,l,a,u,d,f,T,E,S){return this.computeTruncatedText(l,o)}plainText(t,s,i,o,r,l,a,u,d,f,T,E){r=this.computeTruncatedText(r,i),super.plainText(t,s,i,o,r,l,a,u,d,f,T,E)}computeTruncatedText(t,s){if(t==null||this.state.fontSize<=0)return"";try{this.htmlConverter.innerHTML=t,t=O.extractTextWithWhitespace(this.htmlConverter.childNodes);const i=Math.ceil(2*s/this.state.fontSize),o=[];let r=0,l=0;for(;(i==0||r0)break}else o.push(t.charAt(l)),a<255&&r++;l++}o.length1&&(t=O.trim(o.join(""))+"...")}catch(i){console.warn("Error while computing txt label",i)}return t}}const ir=new Map([["dark",{defaultFillColor:"#334352",defaultFontColor:"white",defaultStrokeColor:"#c0ddeb",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#5c8599",laneFillColor:"#2b3742",poolFillColor:"#232b33"}],["brown",{defaultFillColor:"#ede7e1",defaultFontColor:"#414666",defaultStrokeColor:"#414666",flowColor:"#666666",catchAndThrowEventStrokeColor:"#377f87",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#dadce8",laneFillColor:"#d4c3b2",poolFillColor:"#d1b9a1"}],["light-blue",{defaultFillColor:"#ffffff",defaultFontColor:"#002395",defaultStrokeColor:"#002395",endEventFillColor:"#f9dadc",endEventStrokeColor:"#e20613",startEventFillColor:"#ffffff",startEventStrokeColor:"#05d99e",taskAndCallActivityFillColor:"rgba(132,158,253,0.1)",textAnnotationFillColor:"rgba(237,237,245,0.5)",laneFillColor:"#edeef5",poolFillColor:"#dbefff"}]]);class or extends Qo{configureTheme(e){if(e=="default")return new kt(this.graph).configureStyles(),!0;const t=ir.get(e);if(!t)return!1;const s=this.graph.getStylesheet();for(const d of C.eventKinds()){let f,T;switch(d){case"endEvent":{f=t.endEventFillColor,T=t.endEventStrokeColor;break}case"startEvent":{f=t.startEventFillColor,T=t.startEventStrokeColor;break}case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":{f=t.defaultFillColor,T=t.catchAndThrowEventStrokeColor??t.defaultStrokeColor;break}default:{f=t.defaultFillColor,T=t.defaultStrokeColor;break}}const E=s.styles[d];E.fillColor=f,E.strokeColor=T}for(const d of C.taskKinds()){const f=s.styles[d];f.fillColor=t.taskAndCallActivityFillColor}const i=s.styles[h.CALL_ACTIVITY];i.fillColor=t.taskAndCallActivityFillColor;const o=s.styles[h.TEXT_ANNOTATION];o.fillColor=t.textAnnotationFillColor??p.TEXT_ANNOTATION_FILL_COLOR;const r=s.styles[h.POOL];r.fillColor=t.poolFillColor,r.swimlaneFillColor=t.defaultFillColor;const l=s.styles[h.LANE];l.fillColor=t.laneFillColor;const a=s.getDefaultVertexStyle();a.fontColor=t.defaultFontColor,a.fillColor=t.defaultFillColor,a.strokeColor=t.defaultStrokeColor;const u=s.getDefaultEdgeStyle();return u.fontColor=t.defaultFontColor,u.fillColor=t.defaultFillColor,u.strokeColor=t.flowColor??t.defaultStrokeColor,!0}configureSequenceFlowColor(e){k(`Use dedicated ${e} color for sequence flows`);const s=this.graph.getStylesheet().styles[M.SEQUENCE_FLOW];s[c.STYLE_STROKECOLOR]=e,s[c.STYLE_FILLCOLOR]=e,k("Sequence flows style updated")}}let N,H={},qe,Qe,Ne,G;function Ar(n){A("Updating load options"),H.fit=n,A("Load options updated",H)}function Or(){return{...H}}function Nr(){return Ne}function vr(n){A("Switching theme from %s to %s",Ne,n),N.configureTheme(n)?(N.graph.refresh(),A("Theme switch done"),Ne=n):A("Unknown theme, do nothing")}function Xt(n,e=!0){A("Loading bpmn...");try{N.load(n,H),A("BPMN loaded with configuration",H),lr(Qe),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(t){if(e)qe(`Cannot load the BPMN diagram: ${t instanceof Error?t.message:String(t)}`);else throw t}}function Lr(n){A("Fitting..."),N.navigation.fit(n),A("Fit done with configuration",n)}function yr(n){A(`Zooming '${n}'...`),N.navigation.zoom(n),A("Zoom done")}function _r(n){return N.bpmnElementsRegistry.getModelElementsByKinds(n)}function rr(n){return N.bpmnElementsRegistry.getModelElementsByIds(n)}function $t(n){const e=N.graph.model,t=e.getCell(n);return e.getParent(t)}function wr(n){return n.map(e=>$t(e).getId()).filter((e,t,s)=>s.indexOf(e)===t)}function br(n){var s;const e=$t(n),t=rr(e.getId());return t&&((s=t[0])==null?void 0:s.kind)===h.SUB_PROCESS}function Rr(n,e){return N.bpmnElementsRegistry.addCssClasses(n,e)}function Fr(n,e){return N.bpmnElementsRegistry.removeCssClasses(n,e)}function Pr(n,e){return N.bpmnElementsRegistry.addOverlays(n,[e])}function kr(n){return N.bpmnElementsRegistry.removeAllOverlays(n)}function lr(n){if(!Qe)return;A("Updating model, bpmnElement to collapse:",n);const e=N.graph.getModel(),t=e.getCell(n);if(t){e.beginUpdate();try{e.setCollapsed(t,!0)}finally{e.endUpdate()}A("Model updated")}else A("Element not found in the model, do nothing")}function Zt(n){const e=new FileReader;e.addEventListener("load",()=>{Xt(e.result)}),e.readAsText(n)}function xr(n){const e=n.target.files;if(e&&e.length>0){const t=e[0];Zt(t)}}function ar(n){Jo(n).catch(e=>{throw new Error(`Unable to fetch ${n}. ${e}`)}).then(e=>(A("BPMN content fetched"),e)).then(e=>{Xt(e,!1),A(`BPMN content loaded from url ${n}`)}).then(()=>{Tr()}).catch(e=>{qe(e.message)})}function Mr(n){Dt(n)}function cr(n){Ht(n)}function ur(n,e){var o;const t=((o=n.loadOptions)==null?void 0:o.fit)??{},s=e.get("fitTypeOnLoad");s&&(t.type=s);const i=e.get("fitMargin");return i&&(t.margin=Number(i)),t}function dr(n){if(n.get("style.container.alternative.background.color")=="true"){const o="yellow";k("Use alternative color for the bpmn container background, color",o);const r=N.graph.container;r.style.backgroundColor=o,k("Bpmn container style updated")}const t=n.get("style.theme");k(`Configuring the '${t}' BPMN theme`),N.configureTheme(t)?(Ne=t,k(`'${t}' BPMN theme configured`)):k(`Unknown '${t}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&N.configureSequenceFlowColor("#E9E9E9"),k('Configuring the "Update Style" API from query parameters'),[...n.keys()].some(o=>o.startsWith("style.api."))?(G={stroke:{},font:{},fill:{}},n.get("style.api.stroke.color")&&(G.stroke.color=n.get("style.api.stroke.color")),n.get("style.api.font.color")&&(G.font.color=n.get("style.api.font.color")),n.get("style.api.font.opacity")&&(G.font.opacity=Number(n.get("style.api.font.opacity"))),n.get("style.api.fill.color")?G.fill.color=n.get("style.api.fill.color"):n.get("style.api.fill.color.startColor")&&n.get("style.api.fill.color.endColor")&&n.get("style.api.fill.color.direction")&&(G.fill.color={startColor:n.get("style.api.fill.color.startColor"),endColor:n.get("style.api.fill.color.endColor"),direction:n.get("style.api.fill.color.direction")}),n.get("style.api.fill.opacity")&&(G.fill.opacity=Number(n.get("style.api.fill.opacity"))),k('Prepared "Update Style" API object',G)):k('No query parameters, do not set the "Update Style" API object')}function hr(n){Qe=n.get("bpmn.element.id.collapsed")}function fr(n){const e=n.get("bpmn.filter.pool.ids");if(!e)return;const t=e.split(",");return A("Configuring load options to only include pool id: ",t),{pools:t.map(s=>({id:s}))}}function Br(n){const e=k;e("Initializing BpmnVisualization with container:",n.globalOptions.container);const t=new URLSearchParams(window.location.search),s=t.get("renderer.ignore.bpmn.colors");if(s){const o=s==="true";e('Ignore support for "BPMN in Color"?',o),!n.globalOptions.renderer&&(n.globalOptions.renderer={}),n.globalOptions.renderer.ignoreBpmnColors=o}N=new or(n.globalOptions),e("Initialization completed"),new nr(window,"drop-container",N.graph.container,Zt),e("Drag&Drop support initialized"),qe=n.statusKoNotifier??cr,e("Configuring Load Options"),H=n.loadOptions??{},H.fit=ur(n,t),H.modelFilter=fr(t),dr(t),hr(t),e("Checking if an 'url to fetch BPMN content' is provided as query parameter");const i=t.get("url");if(i){const o=decodeURIComponent(i);ar(o);return}e("No 'url to fetch BPMN content' provided")}function Gr(){te("Trigger SVG Download"),er(new zt(N.graph).exportSvg())}function Vr(){te("Trigger PNG Download"),tr(new zt(N.graph).exportSvgForPng())}function Yr(){const n=N.getVersion();return A("Version:",n),n}function gr(n,e){A("Applying style using the style API: %O",e),N.bpmnElementsRegistry.updateStyle(n,e),A("New style applied on: %O",n)}function Ur(n){A("Resetting styles using the style API!"),N.bpmnElementsRegistry.resetStyle(n),A("Styles reset")}function Tr(){if(G){const n=pr();A("Number of elements whose style is to be updated",n.length),gr(n,G)}}function pr(){A("Retrieving ids of all BPMN elements");const n=[...Object.values(h),...Object.values(M)],e=N.bpmnElementsRegistry.getModelElementsByKinds(n).map(t=>t.id);return A("All BPMN elements ids retrieved:",e.length),e}export{ce as F,h as S,tn as Z,vr as a,Yr as b,Nr as c,Cr as d,kr as e,Lr as f,Or as g,xr as h,Rr as i,Gr as j,Vr as k,A as l,br as m,_r as n,gr as o,C as p,wr as q,Fr as r,Br as s,Ur as t,Ar as u,is as v,Mr as w,Pr as x,yr as z};
+`}computeSvg(e){const t=e.scale??1,s=e.border??0,i=e.crisp??!0,o=e.enableForeignObjectForLabel??!0,r=this.graph.getGraphBounds(),l=this.graph.view.scale,a=O.createXmlDocument(),u=a.createElementNS(c.NS_SVG,"svg"),d=t/l,f=Math.max(1,Math.ceil(r.width*d)+2*s),T=Math.max(1,Math.ceil(r.height*d)+2*s);u.setAttribute("version","1.1"),u.setAttribute("width",f+"px"),u.setAttribute("height",T+"px"),u.setAttribute("viewBox",(i?"-0.5 -0.5":"0 0")+" "+f+" "+T),a.append(u);const E=a.createElementNS(c.NS_SVG,"g");u.append(E);const S=this.createSvgCanvas(E);S.foEnabled=o,S.foOffset=i?-.5:0,S.textOffset=i?-.5:0,S.imageOffset=i?-.5:0,S.translate(Math.floor((s/t-r.x)/l),Math.floor((s/t-r.y)/l)),S.scale(d);const B=new L.mxImageExport;return B.includeOverlays=!0,B.drawState(this.graph.getView().getState(this.graph.model.root),S),a}createSvgCanvas(e){const t=new lr(e);return t.pointerEvents=!0,t}}class lr extends he{constructor(t){super(t);g(this,"htmlConverter",document.createElement("div"))}getAlternateText(t,s,i,o,r,l,a,u,d,f,T,E,S){return this.computeTruncatedText(l,o)}plainText(t,s,i,o,r,l,a,u,d,f,T,E){r=this.computeTruncatedText(r,i),super.plainText(t,s,i,o,r,l,a,u,d,f,T,E)}computeTruncatedText(t,s){if(t==null||this.state.fontSize<=0)return"";try{this.htmlConverter.innerHTML=t,t=O.extractTextWithWhitespace(this.htmlConverter.childNodes);const i=Math.ceil(2*s/this.state.fontSize),o=[];let r=0,l=0;for(;(i==0||r0)break}else o.push(t.charAt(l)),a<255&&r++;l++}o.length1&&(t=O.trim(o.join(""))+"...")}catch(i){console.warn("Error while computing txt label",i)}return t}}const ar=new Map([["dark",{defaultFillColor:"#334352",defaultFontColor:"white",defaultStrokeColor:"#c0ddeb",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#5c8599",laneFillColor:"#2b3742",poolFillColor:"#232b33"}],["brown",{defaultFillColor:"#ede7e1",defaultFontColor:"#414666",defaultStrokeColor:"#414666",flowColor:"#666666",catchAndThrowEventStrokeColor:"#377f87",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#dadce8",laneFillColor:"#d4c3b2",poolFillColor:"#d1b9a1"}],["light-blue",{defaultFillColor:"#ffffff",defaultFontColor:"#002395",defaultStrokeColor:"#002395",endEventFillColor:"#f9dadc",endEventStrokeColor:"#e20613",startEventFillColor:"#ffffff",startEventStrokeColor:"#05d99e",taskAndCallActivityFillColor:"rgba(132,158,253,0.1)",textAnnotationFillColor:"rgba(237,237,245,0.5)",laneFillColor:"#edeef5",poolFillColor:"#dbefff"}]]);class cr extends nr{configureTheme(e){if(e=="default")return new Bt(this.graph).configureStyles(),!0;const t=ar.get(e);if(!t)return!1;const s=this.graph.getStylesheet();for(const d of I.eventKinds()){let f,T;switch(d){case"endEvent":{f=t.endEventFillColor,T=t.endEventStrokeColor;break}case"startEvent":{f=t.startEventFillColor,T=t.startEventStrokeColor;break}case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":{f=t.defaultFillColor,T=t.catchAndThrowEventStrokeColor??t.defaultStrokeColor;break}default:{f=t.defaultFillColor,T=t.defaultStrokeColor;break}}const E=s.styles[d];E.fillColor=f,E.strokeColor=T}for(const d of I.taskKinds()){const f=s.styles[d];f.fillColor=t.taskAndCallActivityFillColor}const i=s.styles[h.CALL_ACTIVITY];i.fillColor=t.taskAndCallActivityFillColor;const o=s.styles[h.TEXT_ANNOTATION];o.fillColor=t.textAnnotationFillColor??p.TEXT_ANNOTATION_FILL_COLOR;const r=s.styles[h.POOL];r.fillColor=t.poolFillColor,r.swimlaneFillColor=t.defaultFillColor;const l=s.styles[h.LANE];l.fillColor=t.laneFillColor;const a=s.getDefaultVertexStyle();a.fontColor=t.defaultFontColor,a.fillColor=t.defaultFillColor,a.strokeColor=t.defaultStrokeColor;const u=s.getDefaultEdgeStyle();return u.fontColor=t.defaultFontColor,u.fillColor=t.defaultFillColor,u.strokeColor=t.flowColor??t.defaultStrokeColor,!0}configureSequenceFlowColor(e){k(`Use dedicated ${e} color for sequence flows`);const s=this.graph.getStylesheet().styles[M.SEQUENCE_FLOW];s[c.STYLE_STROKECOLOR]=e,s[c.STYLE_FILLCOLOR]=e,k("Sequence flows style updated")}}let N,H={},et,tt,Ne,G;function Lr(n){A("Updating load options"),H.fit=n,A("Load options updated",H)}function yr(){return{...H}}function _r(){return Ne}function wr(n){A("Switching theme from %s to %s",Ne,n),N.configureTheme(n)?(N.graph.refresh(),A("Theme switch done"),Ne=n):A("Unknown theme, do nothing")}function jt(n,e=!0){A("Loading bpmn...");try{N.load(n,H),A("BPMN loaded with configuration",H),dr(tt),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(t){if(e)et(`Cannot load the BPMN diagram: ${t instanceof Error?t.message:String(t)}`);else throw t}}function Rr(n){A("Fitting..."),N.navigation.fit(n),A("Fit done with configuration",n)}function br(n){A(`Zooming '${n}'...`),N.navigation.zoom(n),A("Zoom done")}function Fr(n){return N.bpmnElementsRegistry.getModelElementsByKinds(n)}function ur(n){return N.bpmnElementsRegistry.getModelElementsByIds(n)}function qt(n){const e=N.graph.model,t=e.getCell(n);return e.getParent(t)}function Pr(n){return n.map(e=>qt(e).getId()).filter((e,t,s)=>s.indexOf(e)===t)}function kr(n){var s;const e=qt(n),t=ur(e.getId());return t&&((s=t[0])==null?void 0:s.kind)===h.SUB_PROCESS}function xr(n,e){return N.bpmnElementsRegistry.addCssClasses(n,e)}function Mr(n,e){return N.bpmnElementsRegistry.removeCssClasses(n,e)}function Br(n,e){return N.bpmnElementsRegistry.addOverlays(n,[e])}function Gr(n){return N.bpmnElementsRegistry.removeAllOverlays(n)}function dr(n){if(!tt)return;A("Updating model, bpmnElement to collapse:",n);const e=N.graph.getModel(),t=e.getCell(n);if(t){e.beginUpdate();try{e.setCollapsed(t,!0)}finally{e.endUpdate()}A("Model updated")}else A("Element not found in the model, do nothing")}function Qt(n){n.text().then(e=>{jt(e)}).catch(e=>{throw e})}function Vr(n){const e=n.target.files;if(e&&e.length>0){const t=e[0];Qt(t)}}function hr(n){sr(n).catch(e=>{throw new Error(`Unable to fetch ${n}. ${e}`)}).then(e=>(A("BPMN content fetched"),e)).then(e=>{jt(e,!1),A(`BPMN content loaded from url ${n}`)}).then(()=>{Ir()}).catch(e=>{et(e.message)})}function Yr(n){zt(n)}function fr(n){Xt(n)}function gr(n,e){var o;const t=((o=n.loadOptions)==null?void 0:o.fit)??{},s=e.get("fitTypeOnLoad");s&&(t.type=s);const i=e.get("fitMargin");return i&&(t.margin=Number(i)),t}function Tr(n){if(n.get("style.container.alternative.background.color")=="true"){const o="yellow";k("Use alternative color for the bpmn container background, color",o);const r=N.graph.container;r.style.backgroundColor=o,k("Bpmn container style updated")}const t=n.get("style.theme");k(`Configuring the '${t}' BPMN theme`),N.configureTheme(t)?(Ne=t,k(`'${t}' BPMN theme configured`)):k(`Unknown '${t}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&N.configureSequenceFlowColor("#E9E9E9"),k('Configuring the "Update Style" API from query parameters'),[...n.keys()].some(o=>o.startsWith("style.api."))?(G={stroke:{},font:{},fill:{}},n.get("style.api.stroke.color")&&(G.stroke.color=n.get("style.api.stroke.color")),n.get("style.api.font.color")&&(G.font.color=n.get("style.api.font.color")),n.get("style.api.font.opacity")&&(G.font.opacity=Number(n.get("style.api.font.opacity"))),n.get("style.api.fill.color")?G.fill.color=n.get("style.api.fill.color"):n.get("style.api.fill.color.startColor")&&n.get("style.api.fill.color.endColor")&&n.get("style.api.fill.color.direction")&&(G.fill.color={startColor:n.get("style.api.fill.color.startColor"),endColor:n.get("style.api.fill.color.endColor"),direction:n.get("style.api.fill.color.direction")}),n.get("style.api.fill.opacity")&&(G.fill.opacity=Number(n.get("style.api.fill.opacity"))),k('Prepared "Update Style" API object',G)):k('No query parameters, do not set the "Update Style" API object')}function pr(n){tt=n.get("bpmn.element.id.collapsed")}function Er(n){const e=n.get("bpmn.filter.pool.ids");if(!e)return;const t=e.split(",");return A("Configuring load options to only include pool id: ",t),{pools:t.map(s=>({id:s}))}}function Ur(n){const e=k;e("Initializing BpmnVisualization with container:",n.globalOptions.container);const t=new URLSearchParams(window.location.search),s=t.get("renderer.ignore.bpmn.colors");if(s){const o=s==="true";e('Ignore support for "BPMN in Color"?',o),!n.globalOptions.renderer&&(n.globalOptions.renderer={}),n.globalOptions.renderer.ignoreBpmnColors=o}N=new cr(n.globalOptions),e("Initialization completed"),new rr(window,"drop-container",N.graph.container,Qt),e("Drag&Drop support initialized"),et=n.statusKoNotifier??fr,e("Configuring Load Options"),H=n.loadOptions??{},H.fit=gr(n,t),H.modelFilter=Er(t),Tr(t),pr(t),e("Checking if an 'url to fetch BPMN content' is provided as query parameter");const i=t.get("url");if(i){const o=decodeURIComponent(i);hr(o);return}e("No 'url to fetch BPMN content' provided")}function Dr(){te("Trigger SVG Download"),ir(new Zt(N.graph).exportSvg())}function Wr(){te("Trigger PNG Download"),or(new Zt(N.graph).exportSvgForPng())}function Hr(){const n=N.getVersion();return A("Version:",n),n}function Sr(n,e){A("Applying style using the style API: %O",e),N.bpmnElementsRegistry.updateStyle(n,e),A("New style applied on: %O",n)}function Kr(n){A("Resetting styles using the style API!"),N.bpmnElementsRegistry.resetStyle(n),A("Styles reset")}function Ir(){if(G){const n=mr();A("Number of elements whose style is to be updated",n.length),Sr(n,G)}}function mr(){A("Retrieving ids of all BPMN elements");const n=[...Object.values(h),...Object.values(M)],e=N.bpmnElementsRegistry.getModelElementsByKinds(n).map(t=>t.id);return A("All BPMN elements ids retrieved:",e.length),e}export{ce as F,h as S,on as Z,wr as a,Hr as b,_r as c,vr as d,Gr as e,Rr as f,yr as g,Vr as h,xr as i,Dr as j,Wr as k,A as l,kr as m,Fr as n,Sr as o,I as p,Pr as q,Mr as r,Ur as s,Kr as t,Lr as u,ls as v,Yr as w,Br as x,br as z};
diff --git a/demo/monitoring-all-process-instances/index.html b/demo/monitoring-all-process-instances/index.html
index 82d3b988..dd16a82e 100644
--- a/demo/monitoring-all-process-instances/index.html
+++ b/demo/monitoring-all-process-instances/index.html
@@ -24,7 +24,7 @@
-
+
diff --git a/demo/prediction/index.html b/demo/prediction/index.html
index 14acd3dc..253ba188 100644
--- a/demo/prediction/index.html
+++ b/demo/prediction/index.html
@@ -30,7 +30,7 @@
-
+
diff --git a/demo/static/js/use-case.js b/demo/static/js/use-case.js
index 795f57c5..59093485 100644
--- a/demo/static/js/use-case.js
+++ b/demo/static/js/use-case.js
@@ -17,7 +17,9 @@ class UseCase {
this.#navigationEnabled = navigationEnabled;
this.#loadOptions = {...defaultLoadOptions, ...loadOptions};
- document.querySelector(`[id*="title"]`).textContent = title;
+ if(title) {
+ document.querySelector(`[id*="title"]`).textContent = title;
+ }
document.querySelector(`[id*="bpmn-container"]`).textContent = undefined;
}
diff --git a/examples/custom-behavior/apply-css-classes/index.html b/examples/custom-behavior/apply-css-classes/index.html
index ccd86283..529433f3 100644
--- a/examples/custom-behavior/apply-css-classes/index.html
+++ b/examples/custom-behavior/apply-css-classes/index.html
@@ -86,7 +86,7 @@
}
-
+
diff --git a/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html b/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html
index 1a6cdaf7..7229ea42 100644
--- a/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html
+++ b/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html
@@ -34,7 +34,7 @@
-
+
diff --git a/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html b/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html
index 41817389..61e1adef 100644
--- a/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html
+++ b/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html
@@ -36,7 +36,7 @@
-
+
diff --git a/examples/custom-behavior/call-activity-with-tabs-on-click/index.html b/examples/custom-behavior/call-activity-with-tabs-on-click/index.html
index 6aeb91b1..982d9414 100644
--- a/examples/custom-behavior/call-activity-with-tabs-on-click/index.html
+++ b/examples/custom-behavior/call-activity-with-tabs-on-click/index.html
@@ -36,7 +36,7 @@
-
+
diff --git a/examples/custom-behavior/growing-sequence-flow/index.html b/examples/custom-behavior/growing-sequence-flow/index.html
index 31693e9c..e5113da5 100644
--- a/examples/custom-behavior/growing-sequence-flow/index.html
+++ b/examples/custom-behavior/growing-sequence-flow/index.html
@@ -57,7 +57,7 @@
-
+
diff --git a/examples/custom-behavior/javascript-tooltip-and-popover/index.html b/examples/custom-behavior/javascript-tooltip-and-popover/index.html
index 2c045e81..c9affae2 100644
--- a/examples/custom-behavior/javascript-tooltip-and-popover/index.html
+++ b/examples/custom-behavior/javascript-tooltip-and-popover/index.html
@@ -49,7 +49,7 @@
-
+
diff --git a/examples/custom-behavior/running-dashed-message-flow/index.html b/examples/custom-behavior/running-dashed-message-flow/index.html
index cfb24e03..e1fd9fed 100644
--- a/examples/custom-behavior/running-dashed-message-flow/index.html
+++ b/examples/custom-behavior/running-dashed-message-flow/index.html
@@ -57,7 +57,7 @@
-
+
diff --git a/examples/custom-behavior/select-elements-by-bpmn-kind/index.html b/examples/custom-behavior/select-elements-by-bpmn-kind/index.html
index 3e230978..3228d100 100644
--- a/examples/custom-behavior/select-elements-by-bpmn-kind/index.html
+++ b/examples/custom-behavior/select-elements-by-bpmn-kind/index.html
@@ -55,7 +55,7 @@
}
-
+
diff --git a/examples/custom-bpmn-theme/custom-colors/index.html b/examples/custom-bpmn-theme/custom-colors/index.html
index 233cf27a..a3bc4518 100644
--- a/examples/custom-bpmn-theme/custom-colors/index.html
+++ b/examples/custom-bpmn-theme/custom-colors/index.html
@@ -22,7 +22,7 @@
-
+
diff --git a/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html b/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html
index 113d8e1c..33404953 100644
--- a/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html
+++ b/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html
@@ -36,7 +36,7 @@
-
+
diff --git a/examples/custom-bpmn-theme/custom-fonts/index.html b/examples/custom-bpmn-theme/custom-fonts/index.html
index 3669161b..48ea5ecf 100644
--- a/examples/custom-bpmn-theme/custom-fonts/index.html
+++ b/examples/custom-bpmn-theme/custom-fonts/index.html
@@ -22,7 +22,7 @@
-
+
diff --git a/examples/custom-bpmn-theme/custom-user-task-icon/index.html b/examples/custom-bpmn-theme/custom-user-task-icon/index.html
index f4c048ad..bdf39a85 100644
--- a/examples/custom-bpmn-theme/custom-user-task-icon/index.html
+++ b/examples/custom-bpmn-theme/custom-user-task-icon/index.html
@@ -22,7 +22,7 @@
-
+
diff --git a/examples/diagram-navigation/diagram-fit-after-load/index.html b/examples/diagram-navigation/diagram-fit-after-load/index.html
index 5b26f918..71c26a70 100644
--- a/examples/diagram-navigation/diagram-fit-after-load/index.html
+++ b/examples/diagram-navigation/diagram-fit-after-load/index.html
@@ -53,7 +53,7 @@
-
+
diff --git a/examples/diagram-navigation/diagram-fit-on-load/index.html b/examples/diagram-navigation/diagram-fit-on-load/index.html
index 8635282e..550d0ff8 100644
--- a/examples/diagram-navigation/diagram-fit-on-load/index.html
+++ b/examples/diagram-navigation/diagram-fit-on-load/index.html
@@ -40,7 +40,7 @@
-
+
diff --git a/examples/diagram-navigation/diagram-navigation/index.html b/examples/diagram-navigation/diagram-navigation/index.html
index 6616220f..04469342 100644
--- a/examples/diagram-navigation/diagram-navigation/index.html
+++ b/examples/diagram-navigation/diagram-navigation/index.html
@@ -34,7 +34,7 @@
}
-
+
diff --git a/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html b/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html
index e0f8c785..28b0d0eb 100644
--- a/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html
+++ b/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html
@@ -50,7 +50,7 @@
-
+
diff --git a/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html b/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html
index 32b7374e..d9c2917c 100644
--- a/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html
+++ b/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html
@@ -60,7 +60,7 @@
-
+
diff --git a/examples/display-bpmn-diagram/pools-filter-on-load/index.html b/examples/display-bpmn-diagram/pools-filter-on-load/index.html
index 66c6ecca..af14f81b 100644
--- a/examples/display-bpmn-diagram/pools-filter-on-load/index.html
+++ b/examples/display-bpmn-diagram/pools-filter-on-load/index.html
@@ -34,7 +34,7 @@
-
+
diff --git a/examples/misc/compare-with-bpmn-js/index.html b/examples/misc/compare-with-bpmn-js/index.html
index 3f47a275..605166f6 100644
--- a/examples/misc/compare-with-bpmn-js/index.html
+++ b/examples/misc/compare-with-bpmn-js/index.html
@@ -59,7 +59,7 @@
-
+
diff --git a/examples/misc/compare-with-kie-editors-standalone/index.html b/examples/misc/compare-with-kie-editors-standalone/index.html
index d407bb84..543716e5 100644
--- a/examples/misc/compare-with-kie-editors-standalone/index.html
+++ b/examples/misc/compare-with-kie-editors-standalone/index.html
@@ -59,7 +59,7 @@
-
+
diff --git a/examples/overlays/add-remove/index.html b/examples/overlays/add-remove/index.html
index 5c37a8dd..3494b745 100644
--- a/examples/overlays/add-remove/index.html
+++ b/examples/overlays/add-remove/index.html
@@ -48,7 +48,7 @@
-
+
diff --git a/examples/overlays/add-stylized/index.html b/examples/overlays/add-stylized/index.html
index df61e2ac..d8a2acf0 100644
--- a/examples/overlays/add-stylized/index.html
+++ b/examples/overlays/add-stylized/index.html
@@ -43,7 +43,7 @@
-
+
diff --git a/examples/overlays/custom-overlay-default-style/index.html b/examples/overlays/custom-overlay-default-style/index.html
index 88c15a67..301e3e2f 100644
--- a/examples/overlays/custom-overlay-default-style/index.html
+++ b/examples/overlays/custom-overlay-default-style/index.html
@@ -29,7 +29,7 @@
-
+
diff --git a/projects/javascript-vanilla-with-webpack/package.json b/projects/javascript-vanilla-with-webpack/package.json
index 29984372..318d000f 100644
--- a/projects/javascript-vanilla-with-webpack/package.json
+++ b/projects/javascript-vanilla-with-webpack/package.json
@@ -9,7 +9,7 @@
"serve": "webpack serve"
},
"dependencies": {
- "bpmn-visualization": "0.41.0"
+ "bpmn-visualization": "0.42.0"
},
"devDependencies": {
"html-webpack-plugin": "~5.5.3",
diff --git a/projects/typescript-angular/package.json b/projects/typescript-angular/package.json
index 2fcc41db..f454ed4a 100644
--- a/projects/typescript-angular/package.json
+++ b/projects/typescript-angular/package.json
@@ -19,7 +19,7 @@
"@angular/platform-browser": "~15.2.10",
"@angular/platform-browser-dynamic": "~15.2.10",
"@angular/router": "~15.2.10",
- "bpmn-visualization": "0.41.0",
+ "bpmn-visualization": "0.42.0",
"rxjs": "~7.8.1",
"tslib": "~2.5.3",
"zone.js": "~0.12.0"
diff --git a/projects/typescript-lit-element/package.json b/projects/typescript-lit-element/package.json
index 211bd36a..d271a46f 100644
--- a/projects/typescript-lit-element/package.json
+++ b/projects/typescript-lit-element/package.json
@@ -11,7 +11,7 @@
},
"dependencies": {
"lit": "~2.7.5",
- "bpmn-visualization": "0.41.0"
+ "bpmn-visualization": "0.42.0"
},
"devDependencies": {
"patch-package": "~8.0.0",
diff --git a/projects/typescript-vanilla-with-parcel/package.json b/projects/typescript-vanilla-with-parcel/package.json
index fdb5bc41..012a6ef4 100644
--- a/projects/typescript-vanilla-with-parcel/package.json
+++ b/projects/typescript-vanilla-with-parcel/package.json
@@ -8,7 +8,7 @@
"build": "tsc && parcel build --public-url ./ index.html"
},
"dependencies": {
- "bpmn-visualization": "0.41.0"
+ "bpmn-visualization": "0.42.0"
},
"devDependencies": {
"@parcel/core": "~2.10.0",
diff --git a/projects/typescript-vanilla-with-rollup/package.json b/projects/typescript-vanilla-with-rollup/package.json
index db0f3f67..9a9ffcd8 100644
--- a/projects/typescript-vanilla-with-rollup/package.json
+++ b/projects/typescript-vanilla-with-rollup/package.json
@@ -10,7 +10,7 @@
"start": "rollup -cw --environment devMode:true"
},
"dependencies": {
- "bpmn-visualization": "0.41.0"
+ "bpmn-visualization": "0.42.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "~25.0.5",
diff --git a/projects/typescript-vanilla-with-vitejs/package.json b/projects/typescript-vanilla-with-vitejs/package.json
index aac746ea..4049475b 100644
--- a/projects/typescript-vanilla-with-vitejs/package.json
+++ b/projects/typescript-vanilla-with-vitejs/package.json
@@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
- "bpmn-visualization": "0.41.0"
+ "bpmn-visualization": "0.42.0"
},
"devDependencies": {
"typescript": "~4.5.5",
diff --git a/projects/typescript-vue/package.json b/projects/typescript-vue/package.json
index 7cfdf5dd..f772fc6e 100644
--- a/projects/typescript-vue/package.json
+++ b/projects/typescript-vue/package.json
@@ -9,7 +9,7 @@
},
"dependencies": {
"@process-analytics/bv-experimental-add-ons": "0.2.0",
- "bpmn-visualization": "0.41.0",
+ "bpmn-visualization": "0.42.0",
"spectre.css": "~0.5.9",
"vue": "~3.3.4"
},